Opening a form modal from a widget
So im just gonna ask in here again,
I have a widget on my dashboard:
and i have a form in a resource with a wizard:
now i want that button in the widget to open the form modal when it is pressed, but i have no clue how to do this
can anyone help?
2 Replies
you need to add a modal in your view : https://filamentphp.com/docs/3.x/support/blade-components/modal then you add the form into this modal content and your button should trigger $dispatch('open-modal', { id: 'edit-user' }) as mentioned in the doc
Widgets are just livewire components, so you can just add an action to it that has the form. Then just echo the action in the widget’s view.
https://filamentphp.com/docs/3.x/actions/adding-an-action-to-a-livewire-component