Overriding the Notification Panel
Hey, I'm trying to override the notification panel to customise the behaviour of the
clear
button, and therefore also overriding which notifications are listed.
I want to change it so that clear
sets a new cleared_at
column in the database, and doesn't display these in the list, and doesn't delete them from the database.
The reason for this is I want a table which shows all "dismissed" notifications if a user needs to go back and look at previous ones.
I found these two threads, but I've not had any luck overriding the clear buttons functionality (which I was planning to do after the clear button functionality)
https://discord.com/channels/883083792112300104/1237051771797508198
https://discord.com/channels/883083792112300104/1139197733484380300
I've tried both approaches (the Notifications.php file and the two approaches in AppServiceProvider) but I don't seem to be able to override it.4 Replies
Actually just realised, I think both of those are overriding the notification, rather than the panel slide out 😐
You could potentially extend the livewire class and bind it in the container to use yours instead of filament’s. Never tried it though. If that works you could override the methods. But I’m not seeing anything that would allow overrides to the clear action.
Could possibly solve with an observer + query scopes.
The policy would handle the scope too. 🙂