F
Filamentβ€’2mo ago
ElCoco

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
Lara Zeus
Lara Zeusβ€’2mo ago
I think you can use actions with Confirmation modals https://filamentphp.com/docs/3.x/actions/modals
ElCoco
ElCocoβ€’2mo ago
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 πŸ™‚
Lara Zeus
Lara Zeusβ€’2mo ago
you can do nested modal
ElCoco
ElCocoβ€’2mo ago
mmm what do you mean? It would be of great help if you could point me to an example πŸ™‚
Lara Zeus
Lara Zeusβ€’2mo ago
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 πŸ™‚
ElCoco
ElCocoβ€’2mo ago
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.
ElCoco
ElCocoβ€’2mo ago
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 🀣
Want results from more Discord servers?
Add your server