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.
No description
4 Replies
Pekempy
PekempyOP7mo ago
Actually just realised, I think both of those are overriding the notification, rather than the panel slide out 😐
awcodes
awcodes7mo ago
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.
Chrispian
Chrispian7mo ago
Could possibly solve with an observer + query scopes.
awcodes
awcodes7mo ago
The policy would handle the scope too. 🙂
Want results from more Discord servers?
Add your server