by Devin Yang
(This article was automatically translated.)

Published - 6 years ago ( Updated - 6 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

Random passwords in Laravel maintenance mode

The functions mentioned in this article can only be used for Laravel 8 and later versions. If we have some test websites outside Laravel with external IPs, but we only want to access them for ourselves. Here's how I did it for reference

laravel,dotenv,seo

How do I dynamically load different dotenv files in Laravel according to the subdomain name

Before we start, let me complain. Originally, my website could automatically display different languages ​​according to the user's browser. That's okay, but Google's SEO doesn't seem to like it. He recommends using different URLs for each language and not using cookies or browser settings to adjust the content of the page. Well, I'll just be obedient. His suggested method, the first solution: distinguish by country, such as example.tw or example.de, how is this really impossible, or buy the registered domain name, or take all the domain names and no one will take it The strange domain name is more likely. The second solution: use sub-domain names to distinguish, this is what I am going to do, and so on to explain how to do it in Laravel. The third solution: example.com/tw/ and the like, Apple seems to do it this way. The fourth solution: site.com?loc=tw and the like are not recommended, indeed I think this is not a good idea.

docker, tinkerwell, tinker, laravel

Application of Tinkerwell and docker environment

In fact, I don't use Tinkerwell recently because it keeps costing me money to update. If you want to test the direct ssh host, it’s done, isn’t it?