Upgrade Laravel 5.7 to 5.8: Today’s Laravel is the most used framework for building a web application. It is continuously improved and adding new features with its latest version. So, Laravel is preferred to build web applications.
In this tutorial, I am going to explain How to upgrade Laravel to 5.8 from 5.7.
Upgrading to Laravel 5.8 from 5.7
Upgrading to Laravel 5.8
need some pre-requisites like:
PHP >= 7.1.3, OpenSSL PHP Extension, PDO PHP Extension, Mbstring PHP Extension, Tokenizer PHP Extension, XML PHP Extension, Ctype PHP Extension and JSON PHP Extension.
#1: Change laravel/framework version
First, you need to upgrade the laravel/framework dependency in the composer.json file. If you are using Laravel Passport then you should also update your laravel/passport dependency to ^7.0 in your composer.json file.
1 2 3 4 5 6 |
"require": { "php": "^7.1.3", "fideloper/proxy": "^4.0", "laravel/framework": "5.8.*", "laravel/tinker": "^1.0" }, |
After changing the above dependencies, we need to run composer update command to update the Laravel applications.
It will update all the specified version along with all the packages.
#2: Change related dependencies
After changing the laravel/framework version, you need to replace the version of packages under “required-dev” with ‘*’ So, It will tell the composer to install the latest version which is compatible with Laravel 5.8.
1 2 3 4 5 6 7 |
"require-dev": { "filp/whoops": "*", "fzaninotto/faker": "*", "mockery/mockery": "*", "nunomaduro/collision": "*", "phpunit/phpunit": "*" }, |
After replacing all the changing in the composer.json file. type the following command to update it.
1 |
composer update |
#3: Check the Laravel Version
Now, you can confirm the laravel/framework version by typing the below command in your terminal.
1 |
php artisan -v |
Above command will show the laravel/framework version. If it show Laravel 5.8 then your application has been successfully upgraded to 5.8 version.
In this tutorial, you have seen how to