Database Notifications Event Dispatch
Hello,
I was wondering is there event dispatched when filament is sending database notifications?
I was looking for to catching an event with Livewire.on('***')
3 Replies
If i remember database notifications are just a record in the table, the bell component on the dashboard polls the db at intervals to check if there are some, you could create a custom event and emit that right after calling sendToDatabase
Excatly Aivirty, you can use web sockets if desired too, as per the docs
Update for this, I did it with a bit of workaround.
By documentation we can modify https://filamentphp.com/docs/3.x/notifications/customizing-notifications#using-a-custom-notification-view inital view, from there I went to vendor and copy/paste notification view from there. Than i added data attribute to notification body, and in JS via mutation observer did magic to show notifiaction sound. So now it is like broadcasting without actual sockets.