How to upgrade Laravel?
Table of contents:
- # Introduction
- # Upgrade to Laravel 11 from 10
- # Upgrade to Laravel 10 from 9
- # Upgrade to Laravel 9 from 8
- # Upgrade to Laravel 8 from 7
- # Upgrade to Laravel 7 from 6
- # Upgrade to Laravel 6 from 5.8
- # Upgrade to Laravel 5.8 from 5.7
- # Upgrade to Laravel 5.7 from 5.6
- # Upgrade to Laravel 5.6 from 5.5
- # Upgrade to Laravel 5.5 from 5.4
- # Upgrade to Laravel 5.4 from 5.3
- # Upgrade to Laravel 5.3 from 5.2
- # Upgrade to Laravel 5.2 from 5.1
- # Upgrade to Laravel 5.1 from 5.0
- # Upgrade to Laravel 5.0 from 4.2
- # Upgrade to Laravel 4.2 from 4.1
- # Upgrade to Laravel 4.1 from 4.0
- # Upgrade to Laravel 4.0 from 3.2
- # Upgrade to Laravel 3.2.14 from 3.0
- # Older versions <= 3.0
- # Helpful tips
# Introduction
The official upgrade guide is a good starting point to upgrade the Laravel framework. It's a list of all changes in the framework. But it's not enough. You need to know what has changed in the skeleton application (e.g. configuration, migration, language, environment files). You need to know what has changed in the dependencies. The framework must also adapt to the changes in PHP and other dependencies (e.g. Symfony).
I created for you a collection of links to all resources that can help you upgrade your Laravel application. It's a collection of links to the official upgrade guides, release notes, and other resources that can help you upgrade your application and understand what has changed in the framework.
# Upgrade to Laravel 11 from 10
- The Official Upgrade Guide
- Main features
- Requirements
- Compare changes in the skeleton application
- Compare changes in the framework
- Releases notes with all pull requests
- Rector upgrade rules
- Free videos on Laracasts
# Upgrade to Laravel 10 from 9
- The Official Upgrade Guide
- Main features
- Requirements
- Compare changes in the skeleton application
- Compare changes in the framework
- Releases notes with all pull requests
- Rector upgrade rules
- Free videos on Laracasts
# Upgrade to Laravel 9 from 8
- The Official Upgrade Guide
- Main features
- Requirements
- Compare changes in the skeleton application
- Compare changes in the framework
- Releases notes with all pull requests
- Rector upgrade rules
- Free videos on Laracasts
# Upgrade to Laravel 8 from 7
- The Official Upgrade Guide
- Main features
- Requirements
- Compare changes in the skeleton application
- Compare changes in the framework
- Releases notes with all pull requests
- Rector upgrade rules
- Rector rule for Model factories
- Free videos on Laracasts
# Upgrade to Laravel 7 from 6
- The Official Upgrade Guide
- Main features
- Requirements
- Compare changes in the skeleton application
- Compare changes in the framework
- Releases notes with all pull requests
- Rector upgrade rules
-
Rector rules for Symfony 5.x (Laravel 7 upgrades dependencies for Symfony components e.g.
symfony/process
from^4.3.4
to^5.0
, if you use them directly in your codebase, you can automatically update them) - Free videos on Laracasts
# Upgrade to Laravel 6 from 5.8
- The Official Upgrade Guide
- Main features
- Requirements
- Compare changes in the skeleton application
- Compare changes in the framework
- Releases notes with all pull requests
- Rector upgrade rules
- Rector rule for String & Array Helpers
- Free videos on Laracasts
# Upgrade to Laravel 5.8 from 5.7
- The Official Upgrade Guide
- Main features
- Requirements
- Compare changes in the skeleton application
- Compare changes in the framework
- Releases notes with all pull requests
- Rector upgrade rules
- Free videos on Laracasts
# Upgrade to Laravel 5.7 from 5.6
- The Official Upgrade Guide
- Main features
- Requirements
- Compare changes in the skeleton application
- Compare changes in the framework
- Releases notes with all pull requests
- Rector upgrade rules
- Free videos on Laracasts
# Upgrade to Laravel 5.6 from 5.5
- The Official Upgrade Guide
- Main features
- Requirements
- Compare changes in the skeleton application
- Compare changes in the framework
- Releases notes with all pull requests
- Rector upgrade rules
- Free videos on Laracasts
# Upgrade to Laravel 5.5 from 5.4
- The Official Upgrade Guide
- Main features
- Requirements
- Compare changes in the skeleton application
- Compare changes in the framework
- Releases notes with all pull requests
- Rector upgrade rules
- Free videos on Laracasts
# Upgrade to Laravel 5.4 from 5.3
- The Official Upgrade Guide
- Main features
- Requirements
- Compare changes in the skeleton application
- Compare changes in the framework
- Releases notes with all pull requests
- Rector upgrade rules
- Free videos on Laracasts
# Upgrade to Laravel 5.3 from 5.2
- The Official Upgrade Guide
- Main features
- Requirements
- Compare changes in the skeleton application
- Compare changes in the framework
- Rector upgrade rules
- Free videos on Laracasts
# Upgrade to Laravel 5.2 from 5.1
- The Official Upgrade Guide
- Main features
- Requirements
- Compare changes in the skeleton application
- Compare changes in the framework
- Rector upgrade rules
- Free videos on Laracasts
# Upgrade to Laravel 5.1 from 5.0
- The Official Upgrade Guide
- Main features
- Requirements
- Compare changes in the skeleton application
- Compare changes in the framework
- Rector upgrade rules
- Free videos on Laracasts
# Upgrade to Laravel 5.0 from 4.2
- The Official Upgrade Guide
- Main features
- Requirements
- Compare changes in the skeleton application
- Compare changes in the framework
- Rector upgrade rules
- Free videos on Laracasts
# Upgrade to Laravel 4.2 from 4.1
- The Official Upgrade Guide
- Main features
- Requirements
- Compare changes in the skeleton application
- Compare changes in the framework
# Upgrade to Laravel 4.1 from 4.0
- The Official Upgrade Guide
- Main features
- Requirements
- Compare changes in the skeleton application
- Compare changes in the framework
- Changelog on Laravel.io Wiki (archived)
# Upgrade to Laravel 4.0 from 3.2
- List of main features in the repository
- Requirements
- Compare changes in the skeleton application
- The v4.0.11 framework repository
- Free videos on Laracasts
- Video - Migrating Laravel 3 To Laravel 4 by Brandon Boswell
- Article - Upgrading from Laravel 3 to Laravel 4 from yetanotherprogrammingblog.com
# Upgrade to Laravel 3.2.14 from 3.0
- The official Change Log and The Upgrade Guide on GitHub
- The official Change Log and The Upgrade Guide on an archived website (the original website is not available anymore)
- Requirements
- A live copy of original documentation
- Compare changes in the skeleton application
# Older versions <= 3.0
# Helpful tips
# Use Rector to automatically upgrade your code
Rector is a tool that can automatically upgrade your code. It's a good idea to use it before you start upgrading your code manually. It can save you a lot of time.
To upgrade Laravel with Rector you have to install the driftingly/rector-laravel package with Laravel sets of rules:
composer require driftingly/rector-laravel --dev
Then you have two options:
- choose a one rule set for a specific version of Laravel
use RectorLaravel\Set\LaravelSetList;
use Rector\Config\RectorConfig;
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([
LaravelSetList::LARAVEL_100
]);
};
- choose a rule set that has all rule sets from previous versions up to a specific version of Laravel:
use RectorLaravel\Set\LaravelLevelSetList;
use Rector\Config\RectorConfig;
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([
LaravelLevelSetList::UP_TO_LARAVEL_100
]);
};
# Update many Composer dependencies at once
When upgrading to the newest version of Laravel, you may need to update many of your dependencies because of version constraints in your composer.json file. If you want to update many Composer dependencies at once, you can add more packages to the Composer update command:
composer update laravel/sail laravel/tinker laravel/framework