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.

dlaravel

Ha, I successfully made D-Larave run in the Raspberry Pi ARM environment

I bought the Raspberry Pi this time because I thought it was very fun. In addition, the Mac environment in my home is too new to compile Line Simple Beacon normally. Through the Raspberry Pi, it is easy to use, and there will be no problems in the environment. Of course, there are more applications. But as the author of D-Laravel, of course I have to come and give it a try.....

d-laravel, docker, laravel, docker-compose

D-Laravel v1.0.0 release change description

In order to allow the container to be used more flexibly, D-Laravel has released version v1.0.0, which is not backward compatible. https://github.com/DevinY/dlaravel/releases/tag/v1.0.0 If you are using before v1.0.0, you need to modify the .env file of the Laravel project, change DB_HOST=127.0.0.1 to DB_HOST=db If you have a custom docker-compose-custom.yml file....more