Showing notifications as modals
Sometimes I want to ensure that the user gets the notification and acknowledge it. There is a way to open a notification as a modal with just one button "OK"?
If there isn't, can I open a modal on demand? On the filament docs all the modals are highly tied to forms and actions, I couldn't find a way to do something like Filament::ShowModal("My message here", "OK")
I guess I could use a livewire modal, but I want the modal to fit with the look and feel of filament UI out of the box.
8 Replies
I think you can use actions with
Confirmation modals
https://filamentphp.com/docs/3.x/actions/modals
No, that one shows before the action, I want a modal after the action so I can show a breakdown of what the action did. Thanks for you answer π
you can do nested modal
mmm what do you mean? It would be of great help if you could point me to an example π
not sure if its what you want, but you can add an action with Confirmation modals
then when clicking
submit
you do the action you want and then open another modal
https://filamentphp.com/docs/3.x/actions/modals#opening-another-modal-from-an-extra-footer-action
i am thinking out loud, not 100% sure πOh this is cool, but is not what I want (because still requires to trigger another action by pressing a button). I found a solution that might work using javascript events. Now I just need to find if there is a <x-filament-modal> blade tag or something similar in filament so I can make the modal look filament like.
Solution
I will post the full solution when I have it
lol actually that link I passed is EXACTLY what I need, so yeah, that is the solution π€£