This document provides a complete overview of the migration process from Laravel 9.16 to Laravel 11, including the integration of Laravel Reverb for real-time WebSocket broadcasting.
^8.2^11.0laravel/reverb ^1.0^4.0^3.0^11.0bootstrap/app.php to the Laravel 11 fluent bootstrap APIbootstrap/app.phpbootstrap/app.phpconfig/app.php → providers)config/app.php → Removed manual provider registrationconfig/broadcasting.php → Added Reverb configphpunit.xml → Updated schema for PHPUnit 11composer update
Review breaking changes if you use:
php artisan install:broadcasting
This will:
.env variables.env VariablesBROADCAST_DRIVER=reverb
REVERB_APP_ID=your-app-id
REVERB_APP_KEY=your-app-key
REVERB_APP_SECRET=your-app-secret
REVERB_HOST=localhost
REVERB_PORT=8080
REVERB_SCHEME=http
Generate new keys:
php artisan reverb:install
Laravel 11 loads routes directly from bootstrap/app.php.
You may safely remove the provider only after confirming everything works.
Once the system is stable:
❌ Remove (if unused):
app/Http/Kernel.phpapp/Console/Kernel.phpLaravel 11 uses bootstrap config instead of Kernel classes.
Keep them until fully migrated.
Move CRON jobs from old app/Console/Kernel.php to:
routes/console.php
use Illuminate\Support\Facades\Schedule;
Schedule::command('sync:exp_vid')->daily();
Schedule::command('provider:token')->everyThirtyMinutes();
Schedule::command('trips:cancel')->everyFifteenMinutes();
Schedule::command('sanctum:prune-expired --hours=24')->daily();
Schedule::command('delivery:send-reminders')
->everyFiveMinutes()
->withoutOverlapping()
->runInBackground();
Start the server:
php artisan reverb:start
Create test channel:
Broadcast::channel('test-channel', fn() => true);
Frontend using Laravel Echo:
import Echo from "laravel-echo";
window.Echo = new Echo({
broadcaster: "reverb",
key: import.meta.env.VITE_REVERB_APP_KEY,
wsHost: import.meta.env.VITE_REVERB_HOST,
wsPort: import.meta.env.VITE_REVERB_PORT ?? 80,
wssPort: import.meta.env.VITE_REVERB_PORT ?? 443,
forcedTLS: (import.meta.env.VITE_REVERB_SCHEME ?? "https") === "https",
enabledTransports: ["ws", "wss"],
});
VITE_REVERB_APP_KEY="${REVERB_APP_KEY}"
VITE_REVERB_HOST="${REVERB_HOST}"
VITE_REVERB_PORT="${REVERB_PORT}"
VITE_REVERB_SCHEME="${REVERB_SCHEME}"
bootstrap/app.php/etc/supervisor/conf.d/reverb.conf
[program:reverb]
command=php /path/to/artisan reverb:start
autostart=true
autorestart=true
user=www-data
redirect_stderr=true
stdout_logfile=/path/to/logs/reverb.log
Reload Supervisor:
supervisorctl reread
supervisorctl update
supervisorctl restart reverb
REVERB_SCHEME=https
REVERB_PORT=443
location /app/ {
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
}
composer update cleanly.env updatedroutes/console.phpClass 'App\Http\Kernel' not found✔ Keep old Kernel files during transition.
.env entriesBROADCAST_DRIVER=reverbroutes/channels.php authorizationIf you want, I can also create:
✅ A PDF Migration Manual
✅ A blog version with headings + SEO
✅ A shortened version for GitHub README
Just tell me what format you prefer, my friend.
Your email address will not be published. Required fields are marked *