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 example, laravel teaching, livewire example, laravel

How to set cultural error messages in Laravel Livewire components

This article uses a simple Laravel livewire example to see how the livewire component verifies user input errors and displays Chinese error messages.

web-hosting,laravel

Zhibang installs Laravel 5.4 experience sharing

Install Laravel 5.4 on Zhibang's Linux 7.0 platform, and successfully execute the case sharing, Because it was originally an old version of PHP, it can be transferred to the new version for free for the first time, So please ask them to open a test php 7.0 environment for us to test, after small adjustments, Laravel's environment can indeed be executed on Accton's managed host. This article introduces how I successfully implemented Laravel's website process in Zhibang.

dlaravel

How to directly execute the php artisan of different projects in the container on the host.

This article is the application teaching of D-Laravel, how to directly execute php artisan in the container on the host side. After customizing the alias, you can directly execute php artisan in the contianer in the project folder on the host side. alias a="../../artisan.sh"