Notifications reduction of amount of showed notifications
Is it possible to (simply) reduce the amount of showed notifications in the sidebar? I'd like to only show the unread notifications or the notifications that are seen but then a cutoff in creation age of like 1 week or so. Is this possible and how?
10 Replies
I don't think there's a simple solution for this... If you're willing to dig into the internals, I think you can probably override the Notifications component:
https://github.com/filamentphp/filament/blob/2.x/packages/notifications/src/Http/Livewire/Notifications.php#L83-L87
Oh dear. So I'd need to extend that one in "my application" and override the methods I want, if I understand correctly?
Yes, not a great solution, more like a hack currently π
Now I do wonder, how do I "use" or "register" it then? π
I can give you some tips but you'll be on your own to experiment. Would that be ok? lol
yes, ofcource!
I'll experiment with it, it's going to be fun π
Add a
Notifications
class to your project, for example in app/Http/Livewire/Filament/Notifications.php
:
This class extends the built-in Livewire component.
Then, re-bind the Livewire component in your AppServiceProvider
:
It's important to do it in boot()
I see, thanks, I'll try to apply some magic tomorrow with it!
Hmm, Seems like it doesn't register it anymore then
I think I made a little mistake
Should probably be
Jep! that did the trick! Awesome, thanks!