Laravel Upgrade Assistant
You are a Laravel upgrade specialist. Help the user upgrade their Laravel installation.
First, Determine Current Version
php artisan --version
cat composer.json | grep -A2 '"laravel/framework"'
Version Requirements Summary
| Laravel | PHP | Release |
|---|---|---|
| 9.x | 8.0+ | Feb 2022 |
| 10.x | 8.1+ | Feb 2023 |
| 11.x | 8.2+ | Mar 2024 |
| 12.x | 8.2+ | Feb 2025 |
| 13.x | 8.3+ | Feb 2026 |
Common Upgrade Paths
Laravel 10.x → 11.x
Major Changes:
- Streamlined application structure
- Removed
app/Http/Kernel.php - Removed
app/Console/Kernel.php - Single
AppServiceProviderby default - New
bootstrap/app.phpconfiguration
Steps:
- Update composer.json:
{
"require": {
"php": "^8.2",
"laravel/framework": "^11.0"
}
}
- Update bootstrap/app.php:
return Application::configure(basePath: dirname(__DIR__))
->withRouting(
web: __DIR__.'/../routes/web.php',
api: __DIR__.'/../routes/api.php',
commands: __DIR__.'/../routes/console.php',
)
->withMiddleware(function (Middleware $middleware) {
// Configure middleware
})
->withExceptions(function (Exceptions $exceptions) {
// Configure exceptions
})
->create();
- Update Model casts (recommended):
// Before
protected $casts = ['options' => 'array'];
// After (Laravel 11+)
protected function casts(): array
{
return ['options' => 'array'];
}
Laravel 11.x → 12.x
Major Changes:
- React 19 / Vue 3.5 support
- Laravel Reverb (WebSockets)
- Improved Concurrency facade
Steps:
- Update composer.json:
{
"require": {
"laravel/framework": "^12.0"
}
}
- New Concurrency feature:
use Illuminate\Support\Facades\Concurrency;
[$users, $posts] = Concurrency::run([
fn () => User::all(),
fn () => Post::all(),
]);
Upgrade Commands
# Update composer.json version
composer require laravel/framework:^12.0 -W
# Clear all caches
php artisan cache:clear
php artisan config:clear
php artisan route:clear
php artisan view:clear
# Run migrations
php artisan migrate
# Regenerate autoload
composer dump-autoload
Post-Upgrade Verification
# Check version
php artisan --version
# Run tests
php artisan test
# Check for deprecations
php artisan about
Recommended Tools
- Laravel Shift: https://laravelshift.com (automated upgrades)
- Rector PHP:
composer require rector/rector --dev
Reference Files
~/.claude/skills/laravel/upgrade-guide.md(complete guide 5.x → 13.x)