Bear in mind
⭐️ Any feedback and contributions are appreciated.
Step-by-Step guide to upgrade Laravel framework version from 7.x to 11.x (⭐️ For PHP project)
-
Create a full backup of your application files and database. (optional)
-
Review official Laravel upgrade guides for versions 8.x, 9.x, 10.x, 11.x to list out detailed information about changes in each version which might affect existing code.
Common Steps
From version 8.x, if you're currently using the job batching then follow : https://laravel.com/docs/8.x/upgrade#failed-jobs-table-batch-support
Local Environment
Remove old files && folders
-
File
composer.lock -
Folder
/vendor
Check current version composer
Prerequisites, php container must be running:
docker-compose up
↓ <br>
Connect to php container:
# For Windows:
winpty docker-compose exec your-container-php-name bash
# For macOS:
docker-compose exec your-container-php-name bash
↑ If bash isn't available in your container, use sh instead.
↓ <br> Find location:
which composer
↓ <br> Check current version:
path-to-composer -V
↓ <br> As from Laravel 10.x, Laravel now requires Composer 2.2.0 or greater. (https://laravel.com/docs/10.x/upgrade#updating-dependencies) <br> ↓ <br> If version is < 2, update to the latest one
composer self-update
(Optional) Update to a specific version (https://getcomposer.org) <br> ↓ <br>
composer self-update expected-specific-version
↓ <br> Re-check version:
path-to-composer -V
Update Dependencies
Replace new appropriate version in file composer.json
↓
composer install
↓ <br> Regenerate the list of all the classes that need to be included in the project (autoload_classmap. php)
composer dump-autoload
↓ <br>