Update Laravel version 5.5 to 5.8
Recently, I got a chance to update my current Laravel project version from 5.5. to 5.8. In this post, I will let you know how I achieved it.
I decided to update them one by one and divided problem into three phases which are like:-
- Laravel 5.5 to Laravel 5.6.
- Laravel 5.6 to Laravel 5.7
- Laravel 5.7 to Laravel 5.8
Laravel 5.5 to Laravel 5.6
First of all, I read update document guide of Laravel 5.6 check all changes for version 5.6. I also identify those packages which I am currently using and they need to update. After I make changes in my composer.json and these changes are following.
- "laravel/framework": "5.6.*"
- "phpunit/phpunit": "^7.0",
After update all changes in composer run composer update. After that i make some changes into my config folder these are following:-
- Remove logging information from app.php.
- Copy a new logging.php file from here.
Laravel 5.6 to Laravel 5.7
Again, I start with Laravel 5.7 update Guide and found those packages which are updated in laravel 5.7. So, The only package i needs to update for laravel 5.7 is "laravel/framework": "5.7.*". Laravel 5.6 is not supporting php artisan optimize (check here) that's why i removed it from composer.json.
After these all composer changes I run composer update. Now, My Laravel version is updated to 5.7.
Laravel 5.7 to Laravel 5.8
The package changes i found from Laravel 5.8 update guide is "laravel/framework": "5.8.*" . After that run composer update and finally my project is updated to Laravel 5.8.
Only problem that i faced is it don't support getenv() for resolving this i replace it by env() in whole project (check here). But this issue is resolved in Laravel 5.8.5+.
Only problem that i faced is it don't support getenv() for resolving this i replace it by env() in whole project (check here). But this issue is resolved in Laravel 5.8.5+.
Thank you very much! Your solution saved me money for hiring some external upgrade services
ReplyDeleteHave a great day!