Introduction
Laravel 11 is the most opinionated release in the framework's history. Rather than just adding features, Taylor Otwell and the team made bold decisions to simplify the default application structure, reduce boilerplate, and make Laravel apps leaner by default.
If you're running a Laravel 10 app in production, this guide will walk you through every step of the migration process — from preparation to deployment.
What Changed in Laravel 11
The most noticeable change is the dramatically simplified application structure. Here's what's different:
- No more HTTP Kernel — middleware is now registered in
bootstrap/app.phpusing a fluent API - No more Console Kernel — scheduled tasks are defined in
routes/console.php - No more Exception Handler — exception handling is configured in
bootstrap/app.php - Fewer config files — only the config files you've modified are kept; everything else uses framework defaults
- Fewer service providers — only
AppServiceProviderships by default
The result? A fresh Laravel 11 app has ~70 fewer files than a Laravel 10 app. It feels clean, focused, and easier to understand for newcomers.
Preparing for Migration
Before starting, make sure you have:
- PHP 8.2 or higher — Laravel 11 drops support for PHP 8.1
- Composer 2.x — ensure you're running the latest version
- Full test suite passing — don't migrate with failing tests
- Git branch — create a dedicated migration branch
git checkout -b feature/laravel-11-migration
php artisan test # Make sure everything passes first
Step-by-Step Migration
Step 1: Update composer.json
Update your Laravel framework version and other first-party packages:
"require": {
"laravel/framework": "^11.0",
"laravel/sanctum": "^4.0",
"laravel/tinker": "^2.9"
}
Then run composer update and resolve any dependency conflicts.
Step 2: Migrate the Application Structure
Laravel provides an upgrade command that handles most of the structural changes:
php artisan upgrade
This command will:
- Move middleware registration to
bootstrap/app.php - Move scheduled tasks to
routes/console.php - Consolidate exception handling
- Remove unnecessary config files
Step 3: Review Middleware Changes
If you had custom middleware, you'll need to register it using the new fluent API:
// bootstrap/app.php
return Application::configure(basePath: dirname(__DIR__))
->withMiddleware(function (Middleware $middleware) {
$middleware->append(EnsureJsonResponse::class);
$middleware->alias(['admin' => AdminMiddleware::class]);
})
Step 4: Update Service Providers
Laravel 11 only ships with AppServiceProvider. If you had custom providers, you can either merge them into AppServiceProvider or keep them and register them manually in bootstrap/providers.php.
Step 5: Test Everything
php artisan test
php artisan route:list # Verify all routes are registered
php artisan config:show # Check configuration values
Common Gotchas
- Third-party packages — check that all your packages support Laravel 11 before upgrading
- Custom Artisan commands — the
$scheduleproperty in Kernel no longer works; move scheduling toroutes/console.php - Config caching — if you relied on config files that no longer exist, you'll need to publish them explicitly
Conclusion
Laravel 11 is a breath of fresh air. The simplified structure makes projects easier to navigate, the reduced boilerplate means less code to maintain, and the new APIs are more intuitive. The migration requires some effort, but the result is a cleaner, more modern codebase that's a pleasure to work with.