© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•17mo ago•
6 replies
huppeldepuppel

Modal with dynamic actions

I want to create a Model using a livewire or blade-view that will show a few divs. When the user clicks one of the divs, an action on the main form has to be triggered with the name of the chosen picture as an argument.

What I got working is that I'm able to launch a custom Action of my Livewire modal form, but that seems to do nothing, probably because it's in the wrong place. I think the action has to be defined in my main resource somehow. But then I won't be able to access this action in the modal. Or do I, somehow?
Solution
Ah, so you want to run something after the modal. That's not gonna work that way. You can dispatch Livewire events though and listen to those on your component. Inside your model Livewire component you probably don't even need a Filament action. Just some
wire:click="$dispatch('your-event', 'data')
wire:click="$dispatch('your-event', 'data')
and then you can listen for that on the page and run a method with:

#[On('your-event')]
public function doSomething($data) {}
#[On('your-event')]
public function doSomething($data) {}
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Dynamic actions with modal
FilamentFFilament / ❓┊help
2y ago
Modal Actions
FilamentFFilament / ❓┊help
3y ago
Issue with modal in actions
FilamentFFilament / ❓┊help
3y ago
Edit modal actions
FilamentFFilament / ❓┊help
3y ago