Real-Time Notification System Using Laravel Reverb project screenshot
CASE STUDY

Real-Time Notification System Using Laravel Reverb

WeGetAnyStock · B2B Marketplace

Challenge

The platform needed instant notifications when inventory listings changed status, new enquiries arrived, or admin actions required seller attention. Polling-based updates caused delays and unnecessary server load.

Solution

Astro Dream implemented Laravel Reverb for WebSocket-based real-time notifications. Events broadcast instantly to connected users, with Laravel Echo on the frontend and queued event processing on the backend for reliability.

Technologies used

  • Laravel
  • Laravel Reverb
  • Laravel Echo
  • WebSockets
  • Redis
  • Vue.js
  • Queue Workers

Outcomes achieved

Instant updates

Users receive listing and enquiry notifications in under 500ms without page refresh.

Reduced server load

Eliminated polling requests that generated thousands of unnecessary API calls per hour.

Scalable architecture

WebSocket channels are scoped per user role, supporting concurrent connections as the platform grows.

Why real-time mattered

WeGetAnyStock connects buyers and sellers in a fast-moving inventory marketplace. When a listing status changes — from available to reserved to sold — both parties need to know immediately. Email notifications alone were too slow for time-sensitive deals.

Technical implementation

We deployed Laravel Reverb as the WebSocket server, integrated with the existing Laravel application:

Backend event broadcasting

  • Domain events (listing updated, enquiry received, status changed) implement ShouldBroadcast
  • Events are dispatched to private channels scoped by user ID and role
  • Queue workers process broadcast jobs so HTTP requests stay fast

Frontend with Laravel Echo

  • Vue.js dashboard subscribes to private channels on login
  • Toast notifications appear instantly when relevant events fire
  • Connection state is managed with automatic reconnection on network drops

Channel security

  • Private channels require authentication via Laravel's broadcasting auth endpoint
  • Sellers only receive events for their own listings
  • Admin users subscribe to a separate oversight channel

Infrastructure considerations

Reverb runs alongside the Laravel application with Redis as the broadcast driver. We configured:

  • Supervisor for Reverb and queue worker processes
  • Health checks to restart Reverb if the WebSocket process crashes
  • Graceful degradation — if WebSockets are unavailable, the UI falls back to periodic refresh rather than breaking

Performance results

Before Reverb, the dashboard polled an API endpoint every 10 seconds — roughly 8,600 requests per day per active user. After implementation, WebSocket connections handle all updates with a single persistent connection. Server CPU usage dropped measurably, and users reported faster awareness of time-sensitive listing changes.

View related service All case studies Get a quote