Filament v4 Notifications Not Broadcasting in Real-Time with Laravel Reverb
6 Replies
Sorry, did you just paste some LLM output in here? 🤔
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.I think you should either
->broadcast()
or ->sendToDatabase()
. Not both.
Did you change config/filament.php
as mentioned in the docs?Even using only ->broadcast(), real-time updates still don’t work.
I don't know then. I never set it up myself. Sorry.
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.