by Devin Yang
(This article was automatically translated.)

Published - 7 years ago ( Updated - 7 years ago )

At the beginning, my backend was a framework created by myself, which also uses the MVC architecture, database connection and environment configuration files made by myself, etc.
Include your own template syntax, until I want my framework to support Restful, I have an idea,
Why should I rewrite the same function myself when others have already written it? Would it be better to write it out?
So I started to switch to the framework, and I used Slim at the beginning, mainly because it supports a lower version of php.
Because the classes created by themselves use namespaces, there is no problem in porting them to Slim.
But after trying Slim's twig templates, I feel that it is not as easy to use as Laravel's blade template.
Although I used Slim's framework at the time, I chose to use Laravel's blade template engine on Slim: p,
At that time, I installed philo/laravel-blade . After writing slim for a while, I still prefer the various functions of Laravel.
So I will do the Slim-to-Laravel job again. The process is very smooth, and there is no need to modify the already written template.
It is probably to build the Controller and routing, and do some copy and paste work. It takes less than a day and a half.
Just converted my slime framework to Laravel 5.3.

This time I want to upgrade Larave in the background again, the main reason is because I like the new routing function on 5.5 too much ( in Laravel 5.5, the basic routing is easy to use ),
This will be a lot more convenient for me when I do the front-end versioning. Besides, it is not the first time for the background upgrade to do this kind of thing. It is not difficult for me.
I have done an upgrade to Laravel 5.4 in Laravel 5.3 , with some experience,
So I upgraded again today, and it was easy to do in 30 minutes, so let's talk about my way.

Of course, it is recommended to take a look at the upgrade guide on Laravel's official website:
https://laravel.com/docs/5.5/upgrade

The following is a personal experience sharing, for reference only:

Since my background code and the Class I use are originally my own independent Source Code, it is super easy to upgrade.
It feels a bit like installing a kit feel on the new version of Laravel.

The following is my upgrade process:
1. Directly build a new Laravel 5.5 Project and initialize git version control. I want to know the difference between the old version and the new version.
(Initialize a new Project directly here because I don’t need git modification records before 5.4, and I’ll lose weight by the way.)
2. Modify compose.json, and add the ow_source used in the background to the folder of the app. ow_source is some Classes that survived before I used the framework, and some libraries that need to be used in the background (laravel-debugbar&guzzle).
composer.json
3. Paste the modified .env file into the Laravel 5.5 Project.
4. I have an independent views folder called ow, which contains the layouts, forms, lists, views, and partial in the background, all copied to the resource/views under the new laravel.
5. Several related file adjustments, app/Http/Kernel, some independent Middleware, config/app.php, config/database.php and config/filesystems.php.
6. Migration files and seeds related to the database, and the basic data table in my background (two files).
7. Copy your own package.json, js and css in resource/asset/ to the new version of Laravel, and install npm install.

In less than half an hour, it was done. Then test, add modification and deletion, backup and restore, DebugBar, OAuth login functions.
badkend

Clean installation, backup data restoration php artisan migrate:refresh and php artisan db:seed are all fine: D.
In this update, in the place where OAuth verification is performed, I added an extra login name, because an error occurred during login, saying that the name login could not be found.
Route::get('/我的登入/auth','OAuthCallbackController@sso')->name('login');
restore

Tags: laravel

Devin Yang

Feel free to ask me, if you don't get it.:)

No Comment

Post your comment

Login is required to leave comments

Similar Stories


laravel

Customize your own helper in laravel

In the Laravel framework, a considerable number of PHP functions (php functions), called helpers, are included. https://laravel.com/docs/5.6/helpers So how do we customize our own helper in Laravel? It's actually quite simple.. Just add files in autoload in composer.json.

laravel

Let's run Laravel

If you haven't heard of D-Laravel, let me introduce it. D-Laravel is a Laravel and docker execution environment built with docker-compose. Let us quickly generate Laravel projects through simple bash. This article teaches you how to use the docker image provided by D-Laravel to build a swoole execution development environment. After reading this article, you should be able to quickly create a swoole execution environment through D-Laravel.

laravel

Add fields and update Laravel at the same time

I was told by my friends, Murphy's Law, that promotion is always so difficult, of course I have to show him how smooth I am, I'm not afraid. I also added a column by the way.