© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
30 replies
SirAlyon

Modal Action with Custom Livewire component

Hello everyone, I'm facing an issue with an action in a custom Livewire component. Upon clicking a button, a modal opens with a file uploader inside. Everything seems to be working correctly, but I just can't figure out why the "->action(//mycode....)" method doesn't seem to be triggered upon confirming the action. In fact, upon submitting the modal, I'm redirected back with a 'Saved' success notification. How is it possible that my dd($data) isn't being triggered? What am I missing?

Livewire Controller:

class CreateOpenFundsD extends Component implements HasForms, HasActions
{
    use InteractsWithActions;
    use InteractsWithForms;
    use WithFileUploads;

public function mount(): void
    {
      //....
    }

    public function form(Form $form): Form
    {
        //Only half of my form... (the other one is rendered in the livwire component view)
    }

    public function importHeadersAction(): Action
    {
        return Action::make('importHeaders')
            ->label('Importa Headers')
            ->form([
                FileUpload::make('attachment')
                            ->storeFiles(false)
                            ->label('Carica File (CSV o XLSX)')
                            ->acceptedFileTypes(['text/csv', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'])
                            ->columnSpan(6)
            ])
            ->action(function ($data) {
                dd($data); //how this method is not triggered?
            });

    }
class CreateOpenFundsD extends Component implements HasForms, HasActions
{
    use InteractsWithActions;
    use InteractsWithForms;
    use WithFileUploads;

public function mount(): void
    {
      //....
    }

    public function form(Form $form): Form
    {
        //Only half of my form... (the other one is rendered in the livwire component view)
    }

    public function importHeadersAction(): Action
    {
        return Action::make('importHeaders')
            ->label('Importa Headers')
            ->form([
                FileUpload::make('attachment')
                            ->storeFiles(false)
                            ->label('Carica File (CSV o XLSX)')
                            ->acceptedFileTypes(['text/csv', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'])
                            ->columnSpan(6)
            ])
            ->action(function ($data) {
                dd($data); //how this method is not triggered?
            });

    }


Livewire view:

<form wire:submit="createOrUpdate">
        {{ $this->form }}
  

         <div>
              {{ $this->importHeaders }}
 
              <x-filament-actions::modals />
          </div>

          //other things.....
 </form>
<form wire:submit="createOrUpdate">
        {{ $this->form }}
  

         <div>
              {{ $this->importHeaders }}
 
              <x-filament-actions::modals />
          </div>

          //other things.....
 </form>

Thanks to anyone will help! Bye 🙂
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

Modal: Livewire component
FilamentFFilament / ❓┊help
2y ago
Livewire Table component in a action modal
FilamentFFilament / ❓┊help
10mo ago
Calling Action Modal from parent livewire component
FilamentFFilament / ❓┊help
3y ago
Action modal in livewire component not working
FilamentFFilament / ❓┊help
3y ago