© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•16mo ago•
1 reply
Nikos Koukos

Dispatching a livewire modal from Action in a Table

Hello, i am trying to open a custom livewire modal from an action inside a table i have in a resource.

Action::make('modal_with_voucher_details')
    ->label('Show')
    ->modalHeading('Show')
    ->icon('heroicon-o-eye')
    ->color('gray')
    ->action(function ($record, $livewire ) {
      $livewire ->dispatch('openModal', 'livewire.test_modal',['record' => $record]);
    })
Action::make('modal_with_voucher_details')
    ->label('Show')
    ->modalHeading('Show')
    ->icon('heroicon-o-eye')
    ->color('gray')
    ->action(function ($record, $livewire ) {
      $livewire ->dispatch('openModal', 'livewire.test_modal',['record' => $record]);
    })

But when i click the action nothing happens. I was thinking maybe its because the modal needs the
@livewire('wire-elements-modal')
@livewire('wire-elements-modal')

so that it can open, but i am not sure where i should add this so that it will work.

I have an admin page which has the resources and this resource i am mentioning above. I have also the front page which is in livewire and there the modals work as intented but i cannot make them work from inside the resource action in the admin panel.

Is there a workaround for what i need?
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Livewire Table component in a action modal
FilamentFFilament / ❓┊help
10mo ago
Dispatching a livewire event from a filament action when submit
FilamentFFilament / ❓┊help
2y ago
Dispatching from app.js to Livewire
FilamentFFilament / ❓┊help
3y ago
table action modal
FilamentFFilament / ❓┊help
3y ago