Introduction
Besides flash notifications that appear on-screen, Filament supports sending notifications to the database for persistent storage and broadcasting notifications via websockets for real-time delivery.Database notifications
Database notifications are stored in your database and displayed in a persistent notification modal within Filament panels.Laravel sends database notifications using the queue. Ensure your queue worker is running to receive notifications.
Using with Laravel notification classes
Integrate with traditional Laravel notification classes:Receiving database notifications
Polling for updates
By default, Filament polls for new notifications every 30 seconds:Using websockets for real-time updates
For instant notification delivery, use websockets instead of polling. First, configure Echo in your panel. Then enable event dispatching when sending notifications:DatabaseNotificationsSent event, immediately updating the notification panel.
Marking notifications as read
From notification actions
Add actions that mark individual notifications as read:Mark all as read
Users can mark all notifications as read using the button at the top of the notifications modal.Notification panel positioning
By default, the notification trigger appears in the topbar. Move it to the sidebar:Opening the notifications modal
Trigger the notifications modal programmatically by dispatching a browser event:Broadcast notifications
Broadcast notifications are sent via websockets for real-time delivery without database persistence.Sending broadcast notifications
Use thebroadcast() method: