laravel/reverb
Laravel Reverb adds real-time WebSocket support to Laravel applications, enabling event broadcasting and live updates via a first-party server. Designed to integrate with Laravel’s broadcasting features for fast, reliable real-time communication.
BroadcastServiceProvider) and integrates seamlessly with Redis for pub/sub. This aligns perfectly with Laravel’s event-driven architecture, enabling real-time features (e.g., notifications, live updates) without external dependencies.X-Powered-By: Laravel Reverb header and Pusher-compatible auth signatures (e.g., BroadcastServiceProvider::boot()) reduce client-side refactoring.reload command (v1.6.3) enables zero-downtime updates.php artisan reverb:install), and configure Redis. The BroadcastServiceProvider handles routing automatically.pusher:subscribe auth) via BroadcastServiceProvider::boot(), easing transitions from Pusher.ArrayChannelManager for custom channel logic.RateLimiter in v1.9.0).ChannelCreated).pusher:subscribe)? If yes, verify auth signature compatibility (fixed in v1.8.1).O(N²) pub/sub merge (optimized in v1.10.1).reverb:reload command)?laravel/echo).shouldBroadcast() or middleware.BROADCAST_CONNECTION in .env:
BROADCAST_CONNECTION=redis
QUEUE_CONNECTION=redis
import Echo from 'laravel-echo';
window.Echo = new Echo({
broadcaster: 'reverb',
key: process.env.MIX_PUSHER_APP_KEY,
wsHost: window.location.hostname,
wsPort: 6001, // Default Reverb port
forceTLS: window.location.protocol === 'https:',
});
BroadcastServiceProvider::boot() includes Pusher-compatible auth:
Broadcast::route('private-channel.{id}', function ($user, $id) {
return ['id' => $user->id]; // Pusher-compatible auth
});
| Feature | Compatibility | Notes |
|---|---|---|
| Pusher HTTP API | ✅ (v1.4.0+) | Auth signatures match Pusher’s protocol. |
| Private Channels | ✅ | Uses Laravel’s auth callbacks. |
| Presence Channels | ✅ (v1.5.1+) | Fixed encoding to match Pusher. |
| Client Whispers | ✅ (v1.8.0+) | Restricted to channel members. |
| Rate Limiting | ✅ (v1.9.0+) | Per-channel or global limits. |
| Redis Clustering | ⚠️ (Manual Setup) | Reverb doesn’t auto-discover clusters; requires Redis config. |
| Laravel Echo | ✅ | Works with broadcaster: 'reverb'. |
| Custom Channels | ✅ | Extend ArrayChannelManager or use Channel::make(). |
config/broadcasting.php:
'connections' => [
'redis' => [
'driver' => 'redis',
'connection' => 'cache', // or custom Redis config
'options' => [
'cluster' => env('REDIS_CLUSTER', 'false'),
],
],
],
composer require laravel/reverb
php artisan reverb:install
BroadcastServiceProvider to bind custom channels/middleware.ws://app.test:6001).redis PHP extension (no additional extensions needed).composer update laravel/reverb and php artisan reverb:reload.How can I help you explore Laravel packages today?