Upgrade Laravel 6 to Laravel 7 | Update Laravel Project from 6.0 to 7.0
We are going to upgrade our Laravel 6.0 website to Laravel 7.0 by taking below simple steps.
1) Update composer.json file :-
First of all, update composer.json file to upgrade PHP version from 7.2 to 7.2.5 and laravel/framework to 7.0.* from 6.0 along with many other dependencies as shown in video.
Updated dependencies must look like below :-
“require”: {
“php”: “^7.2.5”,
“fideloper/proxy”: “^4.2”,
“fruitcake/laravel-cors”: “^1.0”,
“guzzlehttp/guzzle”: “^6.3”,
“laravel/framework”: “^7.0”,
“laravel/tinker”: “^2.0”
},
“require-dev”: {
“facade/ignition”: “^2.0”,
“fzaninotto/faker”: “^1.9.1”,
“mockery/mockery”: “^1.3.1”,
“nunomaduro/collision”: “^4.1”,
“phpunit/phpunit”: “^8.5”
},
2) Update Handler.php file :-
Now we will update Handler.php file located at /app/Exceptions/ folder and will replace Exception instance with Throwable everywhere in file as shown in video.
3) Upgrade Laravel/ui Package :-
If you are using Laravel’s authentication scaffolding then you need to upgrade Laravel/ui Package by running below composer command :-
composer require laravel/ui “^2.0”
4) Run “composer update” command :-
Now run “composer update” command to finally upgrade Laravel 6 to 7
5) Verify Laravel version :-
Now you can verify the laravel version by running below artisan command :-
php artisan –version
In my case, its coming like Laravel Framework 7.0.2, check yours.
6) Run Laravel Project :-
Now run your laravel project by running below artisan command :-
php artisan serve
Check everything if working fine after updating your project to Laravel 7.0
Thanks for watching 🙂
source