Filament v4 Notifications Not Broadcasting in Real-Time with Laravel Reverb

6 Replies
Dennis Koch
Dennis Koch•2mo ago
Sorry, did you just paste some LLM output in here? 🤔
MK | Programmer
MK | ProgrammerOP•2mo ago
What I am trying to do: Get real-time database notifications working in Filament v4 with Laravel Reverb (WebSockets). They should appear instantly in the admin panel without refresh. What I did: 1. Set up Laravel Reverb WebSocket server (working) 2. Configured Echo.js 3. Added ->databaseNotifications()->databaseNotificationsPolling('60s') 4. Tested custom broadcast events (working) 5. Verified DB notifications saved correctly My issue: Custom events broadcast instantly, but Filament's Notification::make()->broadcast() does not update the UI in real time. Notifications only appear after page refresh, even though: * WebSocket is connected * DB notifications saved correctly * Queue jobs processed without errors Code (simplified): ''' php Notification::make() ->title('Test Notification') ->body('Only shows on refresh') ->broadcast($user) ->sendToDatabase($user); ''' Echo.js works for custom events: ''' javascript window.Echo.channel('test-channel') .listen('.test.message', (e) => console.log('Custom event received:', e)); ''' Environment: * Laravel 12.x, Filament v4, Reverb v1.0 * Queue workers running Question: What channel or event format does Filament use for broadcasting? ->broadcast($user) seems correct, but frontend doesn’t listen or receive properly.
Dennis Koch
Dennis Koch•2mo ago
I think you should either ->broadcast() or ->sendToDatabase(). Not both. Did you change config/filament.php as mentioned in the docs?
MK | Programmer
MK | ProgrammerOP•2mo ago
Even using only ->broadcast(), real-time updates still don’t work.
'broadcasting' => [
'echo' => [
'broadcaster' => 'reverb',
'key' => env('VITE_REVERB_APP_KEY'),
'cluster' => env('VITE_REVERB_APP_CLUSTER'),
'wsHost' => env('VITE_REVERB_HOST'),
'wsPort' => env('VITE_REVERB_PORT', 6001),
'wssPort' => env('VITE_REVERB_PORT', 6001),
'authEndpoint' => 'broadcasting/auth',
'disableStats' => true,
'encrypted' => env('VITE_REVERB_SCHEME', 'https') === 'https',
'forceTLS' => env('VITE_REVERB_SCHEME', 'https') === 'https',
],
],
'broadcasting' => [
'echo' => [
'broadcaster' => 'reverb',
'key' => env('VITE_REVERB_APP_KEY'),
'cluster' => env('VITE_REVERB_APP_CLUSTER'),
'wsHost' => env('VITE_REVERB_HOST'),
'wsPort' => env('VITE_REVERB_PORT', 6001),
'wssPort' => env('VITE_REVERB_PORT', 6001),
'authEndpoint' => 'broadcasting/auth',
'disableStats' => true,
'encrypted' => env('VITE_REVERB_SCHEME', 'https') === 'https',
'forceTLS' => env('VITE_REVERB_SCHEME', 'https') === 'https',
],
],
Dennis Koch
Dennis Koch•2mo ago
I don't know then. I never set it up myself. Sorry.
MK | Programmer
MK | ProgrammerOP•2mo ago
The funny thing is that my project worked perfectly in version three, but after I updated it a few weeks ago, this happened. I would like to know if anyone has tried using WebSockets with Reverb in Filament 4 recently, to help me out.

Did you find this page helpful?