Open custom modal from anywhere
I want to open a modal from a notification. But 'Filament\Notifications\Actions' doesn't seem to have this capability. So i'm thinking i should dispatch an event to open the modal, but since it's from a notification, the user may be in any part of the system. So where should i put the modal code/event-listener?
Solution
Allright, RenderHooks are definitely the solution here.
I created a Livewire Component to handle the modal opening, and also a custom Action class (PdfListNotificationAction) to encapsulate all the mambo jambo required to set the custom modal content etc:
In the custom component view, i add the filament-action-modal component:
I register the the RenderHook in my AppServiceProvider:
Inside the Job that fires the Database Notification, i just pass an Action that dispatches the event my custom Component listens to:
And voilá! Works like a charm!
I created a Livewire Component to handle the modal opening, and also a custom Action class (PdfListNotificationAction) to encapsulate all the mambo jambo required to set the custom modal content etc:
In the custom component view, i add the filament-action-modal component:
I register the the RenderHook in my AppServiceProvider:
Inside the Job that fires the Database Notification, i just pass an Action that dispatches the event my custom Component listens to:
And voilá! Works like a charm!

