Documentation Index
Fetch the complete documentation index at: https://kawax.biz/llms.txt
Use this file to discover all available pages before exploring further.
Introduction
Laravel 11 was released in March 2024. This guide covers everything you need to upgrade a Laravel 10.x application to 11.x.Estimated upgrade time: about 15 minutes. The actual impact depends on the size of your application and which features you use.
Automated upgrade with Laravel Shift
You can automate much of the upgrade process using Laravel Shift. Shift automatically updates your dependencies and configuration files.Changes by impact level
High impact
- Updating dependencies
- Application structure changes
- Floating-point type changes
- Column modifier persistence when altering columns
- SQLite minimum version
- Sanctum update
Medium impact
- Carbon 3
- Password rehashing
- Per-second rate limiting
- Spatie Once package
Low impact
- Doctrine DBAL removal
- Eloquent model
castsmethod - Spatial type changes
EnumerablecontractUserProvidercontractAuthenticatablecontract
Upgrade steps
Updating dependencies
High impact Update the following entries in yourcomposer.json:
doctrine/dbal manually, you can remove it. Laravel 11 no longer depends on it.
PHP version requirements
High impact Laravel 11 requires PHP 8.2.0 or higher. Laravel’s HTTP client also requires curl 7.34.0 or higher.Application structure changes
High impact Laravel 11 introduces a simplified default application structure with significantly fewer service providers, middleware, and configuration files. However, you do not need to migrate your application structure when upgrading from Laravel 10 to 11. Laravel 11 is designed to support the Laravel 10 application structure as-is. Key structural changes in new Laravel 11 applications:- Middleware, exception handlers, and routing are now configured directly in
bootstrap/app.php app/Http/Kernel.phpis removed and consolidated intobootstrap/app.php- The default number of service providers is reduced; they are managed in
bootstrap/providers.php - Fewer files in
config/(publish them on demand withphp artisan config:publish)
Breaking changes
Authentication
Password rehashing
Medium impact Laravel 11 automatically rehashes passwords at login if the hashing algorithm’s “work factor” has changed. If yourUser model’s password field is named something other than password, specify it with the authPasswordName property:
config/hashing.php:
UserProvider contract
Low impact
The Illuminate\Contracts\Auth\UserProvider contract has a new rehashPasswordIfRequired method. If you have a class that implements this interface, add the method:
Authenticatable contract
Low impact
The Illuminate\Contracts\Auth\Authenticatable contract has a new getAuthPasswordName method. If you have a class that implements this interface, add the method:
Database
SQLite minimum version
High impact If you use SQLite, you now need SQLite 3.26.0 or higher. Note that new Laravel 11 projects default to SQLite as the database driver.Column modifier persistence when altering columns
High impact When altering a column, you must now explicitly re-specify all modifiers you want to keep. Any attribute not listed will be dropped.Floating-point type changes
High impact Thedouble and float migration column types are now consistent across all databases.
unsignedDecimal, unsignedDouble, and unsignedFloat methods have been removed. Use method chaining to add the unsigned attribute:
Eloquent model casts method
Low impact
The base Eloquent model class now defines a casts method. If any of your models define a casts relationship, the name will conflict and must be changed.
MariaDB dedicated driver
Very low impact Laravel 11 adds a dedicated database driver for MariaDB. If you connect to MariaDB, you can now use themariadb driver:
Spatial type changes
Low impact Spatial column types are now consistent across all databases. Replacepoint, lineString, polygon, and similar methods with geometry or geography:
subtype and srid:
Doctrine DBAL removal
Low impact Laravel has removed its dependency on Doctrine DBAL. The following classes and methods have been removed:Schema\Builder::useNativeSchemaOperationsIfPossible()Connection::getDoctrineConnection()Connection::getDoctrineSchemaManager()Connection::registerDoctrineType()DatabaseManager::registerDoctrineType()Schema\Grammars\ChangeColumnclassSchema\Grammars\RenameColumnclass
Schema::getTables(), Schema::getColumns(), Schema::getIndexes(), and Schema::getForeignKeys().
Dates
Carbon 3
Medium impact Laravel 11 supports both Carbon 2 and Carbon 3. If you upgrade to Carbon 3, note thatdiffIn* methods now return floating-point numbers and use negative values to indicate direction in time.
Rate limiting
Per-second rate limiting
Medium impact Laravel 11 now supports per-second rate limiting instead of per-minute. TheGlobalLimit and Limit class constructors now accept seconds.
decayMinutes property on Limit has been renamed to decaySeconds.
The ThrottlesExceptions and ThrottlesExceptionsWithRedis constructors also now accept seconds:
Packages
Publishing service providers
Very low impact New Laravel 11 applications no longer have aproviders array in config/app.php. If your package publishes a service provider, use the ServiceProvider::addProviderToBootstrapFile method:
Sanctum
Sanctum update
High impact Laravel 11 does not support Sanctum 3.x. Update the Sanctum constraint in yourcomposer.json to ^4.0.
Sanctum 4.0 no longer auto-loads migrations. Publish them manually:
config/sanctum.php:
Spatie Once package
Medium impact Laravel 11 ships its ownonce helper. If you use the spatie/once package, remove it from composer.json to avoid conflicts.
Summary
Laravel 11 includes significant structural changes, but since the Laravel 10 application structure continues to work, you can upgrade incrementally.| Change | Impact | Action required |
|---|---|---|
Update composer.json dependencies | High | Change to laravel/framework ^11.0 |
| PHP 8.2 required | High | Check your PHP version |
| Column modifier persistence | High | Review all change() calls in migrations |
| Floating-point type changes | High | Review double/float column definitions |
| SQLite 3.26.0+ required | High | Check your SQLite version |
Sanctum ^4.0 | High | Publish migrations |
| Carbon 3 | Medium | Review diffIn* method return values |
| Per-second rate limiting | Medium | Change decayMinutes to decaySeconds |
| Doctrine DBAL removed | Low | Migrate to native schema methods |
References
- Official upgrade guide
- laravel/laravel diff (10.x → 11.x)
- Laravel Shift — automated upgrade service
- Carbon 3 changelog