Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Reverb Laravel Package

laravel/reverb

Laravel Reverb adds real-time WebSocket support to Laravel, enabling broadcasting and live updates with a first-party, self-hosted server and seamless Laravel integration. Ideal for chat, notifications, and presence features.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

Laravel Reverb is a native replacement for Pusher in Laravel applications, leveraging WebSockets for real-time communication. It integrates seamlessly with Laravel’s existing broadcasting infrastructure, making it ideal for:

  • Chat applications (1:1 or group messaging)
  • Live notifications (e.g., real-time alerts, activity feeds)
  • Collaborative tools (e.g., live document editing, multiplayer games)
  • Dashboards (real-time data updates, stock tickers, IoT telemetry)

The package replaces the dependency on Pusher’s cloud service, reducing vendor lock-in and operational costs while maintaining compatibility with Laravel’s Broadcast facade and event-driven architecture.

Key architectural strengths:Laravel-first design – Built for Laravel’s ecosystem (Laravel 12/13 support, Prompts integration). ✅ Redis-backed – Scales horizontally with Redis Pub/Sub, enabling distributed WebSocket handling. ✅ Pusher API compatibility – Supports Pusher’s HTTP API (e.g., pusher:subscribe), easing migration. ✅ Modular – Supports custom channel authorization, rate limiting, and connection limits.

Potential misfits:Monolithic Laravel dependency – Not suitable for non-Laravel PHP apps (e.g., Symfony, standalone Lumen). ⚠ Redis requirement – Adds operational complexity if Redis isn’t already in use. ⚠ WebSocket-only – No fallback to HTTP long-polling (unlike Pusher), which may impact legacy browser support.


Integration Feasibility

Reverb is designed for drop-in replacement of Pusher in Laravel apps. The integration path is straightforward for teams already using Laravel’s broadcasting system.

Prerequisites:

  • Laravel 12/13 (or 11 with minor adjustments).
  • Redis (v6+ recommended) for pub/sub and connection management.
  • PHP 8.1+ (PHP 8.5 explicitly supported).

Key integration points:

  1. Replace Pusher config (config/broadcasting.php):
    'pusher' => [
        'driver' => 'reverb',
        'key' => env('PUSHER_APP_KEY'),
        'secret' => env('PUSHER_APP_SECRET'),
        'app_id' => env('PUSHER_APP_ID'),
        'options' => [
            'host' => env('REVERB_HOST', '127.0.0.1'),
            'port' => env('REVERB_PORT', 6001),
            'scheme' => env('REVERB_SCHEME', 'http'),
            'datacenter' => false,
            'use_tls' => env('REVERB_SCHEME') === 'https',
            'activity_timeout' => 60,
            'heartbeat' => 10,
        ],
    ],
    
  2. Install Reverb (via Laravel’s reverb:install Artisan command):
    composer require laravel/reverb
    php artisan reverb:install
    
  3. Update client-side JS (if using Pusher JS SDK):
    • Replace Pusher with Reverb (or keep using Pusher JS with Reverb’s HTTP API).
    • Example:
      import Reverb from 'laravel-reverb';
      const reverb = new Reverb({
        key: process.env.MIX_PUSHER_APP_KEY,
        wsHost: window.location.hostname,
        wsPort: 6001,
        forceTLS: window.location.protocol === 'https:',
        enabledTransports: ['ws', 'wss'],
      });
      

Compatibility with existing Laravel features:

  • Events: Works with Laravel’s Event system (e.g., broadcast(new MessageSent($message))).
  • Channels: Supports private/authenticated channels via Laravel’s BroadcastsOn trait.
  • Presence Channels: Full support for tracking online users (e.g., App\Models\User::class).
  • Echo: Compatible with Laravel Echo (with minor config updates).

Technical Risk

Risk Area Assessment Mitigation
Redis dependency Critical for pub/sub and scaling. Downtime or misconfiguration can disrupt real-time features. Use Redis Cluster for HA; monitor Redis health via Laravel Horizon or Prometheus.
WebSocket protocol Browser/OS-level WebSocket limitations (e.g., CORS, NAT traversal). Configure allowed_origins in Reverb; use STOMP over WebSocket for complex cases.
Migration complexity Replacing Pusher may require client-side SDK updates or proxying. Test with a staging environment; use Pusher’s HTTP API as a fallback during transition.
Performance bottlenecks High connection counts may stress Redis or PHP workers. Enable connection limits (max_connections); use Laravel Horizon for queue scaling.
Security WebSocket auth relies on Laravel’s auth system; misconfigurations may expose channels. Audit BroadcastServiceProvider; use BroadcastWhen to restrict channel access.
Monitoring Limited native observability (vs. Pusher’s dashboards). Integrate with Laravel Telescope or Prometheus for metrics (e.g., connections, messages).

Critical questions for stakeholders:

  1. Is Redis already in use? If not, evaluate the operational overhead of adding it.
  2. What’s the expected scale? (e.g., 1K vs. 100K concurrent WebSocket connections).
  3. Are there legacy clients using Pusher’s HTTP API? Reverb supports it, but testing is required.
  4. How will failures be monitored? (e.g., WebSocket disconnections, Redis lag).
  5. Is there a fallback plan for WebSocket outages? (e.g., server-sent events as a backup).

Integration Approach

Stack Fit

Reverb is optimized for Laravel’s stack and integrates cleanly with:

  • Backend: Laravel 12/13 + PHP 8.1+.
  • Database: Redis (required for pub/sub and connection management).
  • Frontend: Laravel Echo + JavaScript (Pusher JS SDK with config tweaks).
  • DevOps: Docker (official laravel/reverb image), Kubernetes (horizontal scaling), or Laravel Forge.

Non-Laravel compatibility:

  • PHP Frameworks: Not directly compatible with Symfony, Lumen, or standalone PHP (requires custom integration).
  • Non-PHP Backends: Requires a Laravel API layer to proxy WebSocket traffic.

Migration Path

Phase Actions Tools/Dependencies
Pre-migration Audit Pusher usage (HTTP API vs. WebSocket). php artisan route:list + code search.
Pilot Environment Install Reverb in staging; test with a subset of features. composer require laravel/reverb, php artisan reverb:install.
Client-Side Update Replace Pusher JS with Reverb config or proxy Pusher requests to Reverb’s HTTP API. Laravel Echo, Pusher JS SDK.
Broadcasting Update Update config/broadcasting.php; test events/channels. Laravel Telescope for debugging.
Load Testing Simulate production traffic; monitor Redis/PHP worker performance. k6, Artisan commands, or Laravel Dusk.
Rollout Gradual switch (e.g., feature flags for WebSocket endpoints). Feature management (e.g., Laravel Nova).
Monitoring Set up alerts for WebSocket errors, Redis latency, or connection drops. Laravel Telescope, Prometheus, or Datadog.

Rollback Plan:

  • Maintain Pusher as a secondary broadcaster (if using HTTP API).
  • Use feature flags to toggle between Pusher and Reverb.

Compatibility

Feature Reverb Support Notes
Pusher JS SDK ✅ (with config tweaks) Update wsHost, wsPort, and wsScheme.
Pusher HTTP API ✅ (partial) Supports pusher:subscribe but may need proxying for other endpoints.
Private Channels Uses Laravel’s auth system (e.g., BroadcastsOn).
Presence Channels Full support with App\Models\User::class.
Server-Sent Events (SSE) Not supported; use WebSockets exclusively.
Cluster Mode Redis Cluster + multiple Reverb instances.
Rate Limiting ✅ (v1.9+) Configure rate_limits in config/broadcasting.php.
Custom Auth
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai