Clear Notification after Button Clicked
Is it possible to clear a specific database notification by clicking an action button?
16 Replies
You can technically just delete the notification directly so no need to clear?
How to access current notification within the Action?
So you want to add a button to the popup notification to clear it?
Yes
Not Popup but Database Notification
But database notifications have an X to them to remove it?
this?
This will close the modal. I want to delete it from the db.
Where are you trying to do it?
From the Notification Modal
Do you have the notification id?
Let me show you a little bit of code.
I guess you can use in the action
->dispatch('notificationClosed', ['id' => 'notificationid'])
If I click on clear, it deletes all notifications for the user. I want to delete only a specific notification after Download button is clicked
Solution
'x-on:click' => 'close'
will delete the notification I guess. Try itPerfect. How did you came to know about this? I mean where to look in docs etc.
The Filament docs are awesome, but sometimes we gotta dive into the source code to get things done.