Upgrade Guide
High Impact Changes
- Updating Dependencies
- Application Structure
- Floating-Point Types
- Modifying Columns
- SQLite Minimum Version
- Updating Sanctum
Medium Impact Changes
Low Impact Changes
- Doctrine DBAL Removal
- Eloquent Model
casts
Method - Spatial Types
- The
Enumerable
Contract - The
UserProvider
Contract - The
Authenticatable
Contract
Upgrading To 11.0 From 10.x
Estimated Upgrade Time: 15 Minutes
We attempt to document every possible breaking change. Since some of these breaking changes are in obscure parts of the framework only a portion of these changes may actually affect your application. Want to save time? You can use Laravel Shift to help automate your application upgrades.
Updating Dependencies
Likelihood Of Impact: High
PHP 8.2.0 Required
Laravel now requires PHP 8.2.0 or greater.
curl 7.34.0 Required
Laravel's HTTP client now requires curl 7.34.0 or greater.
Composer Dependencies
You should update the following dependencies in your application's composer.json
file:
laravel/framework
to^11.0
nunomaduro/collision
to^8.1
laravel/breeze
to^2.0
(If installed)laravel/cashier
to^15.0
(If installed)laravel/dusk
to^8.0
(If installed)laravel/jetstream
to^5.0
(If installed)laravel/octane
to^2.3
(If installed)laravel/passport
to^12.0
(If installed)laravel/sanctum
to^4.0
(If installed)laravel/scout
to^10.0
(If installed)laravel/spark-stripe
to^5.0
(If installed)laravel/telescope
to^5.0
(If installed)livewire/livewire
to^3.4
(If installed)inertiajs/inertia-laravel
to^1.0
(If installed)
If your application is using Laravel Cashier Stripe, Passport, Sanctum, Spark Stripe, or Telescope, you will need to publish their migrations to your application. Cashier Stripe, Passport, Sanctum, Spark Stripe, and Telescope no longer automatically load migrations from their own migrations directory. Therefore, you should run the following command to publish their migrations to your application:
php artisan vendor:publish --tag=cashier-migrations
php artisan vendor:publish --tag=passport-migrations
php artisan vendor:publish --tag=sanctum-migrations
php artisan vendor:publish --tag=spark-migrations
php artisan vendor:publish --tag=telescope-migrations
In addition, you should review the upgrade guides for each of these packages to ensure you are aware of any additional breaking changes:
If you have manually installed the Laravel installer, you should update the installer via Composer:
composer global require laravel/installer:^5.6
Finally, you may remove the doctrine/dbal
Composer dependency if you have previously added it to your application, as Laravel is no longer dependent on this package.
Application Structure
Laravel 11 introduces a new default application structure with fewer default files. Namely, new Laravel applications contain fewer service providers, middleware, and configuration files.
However, we do not recommend that Laravel 10 applications upgrading to Laravel 11 attempt to migrate their application structure, as Laravel 11 has been carefully tuned to also support the Laravel 10 application structure.
Authentication
Password Rehashing
Laravel 11 will automatically rehash your user's passwords during authentication if your hashing algorithm's "work factor" has been updated since the password was last hashed.
Typically, this should not disrupt your application; however, you may disable this behavior by adding the rehash_on_login
option to your application's config/hashing.php
configuration file:
'rehash_on_login' => false,
The UserProvider
Contract
Likelihood Of Impact: Low
The Illuminate\Contracts\Auth\UserProvider
contract has received a new rehashPasswordIfRequired
method. This method is responsible for re-hashing and storing the user's password in storage when the application's hashing algorithm work factor has changed.
If your application or package defines a class that implements this interface, you should add the new rehashPasswordIfRequired
method to your implementation. A reference implementation can be found within the Illuminate\Auth\EloquentUserProvider
class:
public function rehashPasswordIfRequired(Authenticatable $user, array $credentials, bool $force = false);
The Authenticatable
Contract
Likelihood Of Impact: Low
The Illuminate\Contracts\Auth\Authenticatable
contract has received a new getAuthPasswordName
method. This method is responsible for returning the name of your authenticatable entity's password column.
If your application or package defines a class that implements this interface, you should add the new getAuthPasswordName
method to your implementation:
public function getAuthPasswordName()
{
return 'password';
}