© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•10mo ago•
5 replies
Asmit

Help: Multiple actions on livewire page through loop

I want to render multiple action on livewire page, dynamically
I have this method on livewire class,
 protected function getActions(): array
    {
        return [
            Action::make('Create')
                ->modal()
                ->form([
                    TextInput::make('name')
                        ->required()
                        ->default('john'),
                ])
                ->action(function (array $data): void {
                    //
                    );

                }),
            Action::make('Generate')
                ->lavel('Regenerate')
                ->modal()
                ->form([
                    TextInput::make('name')
                        ->required()
                        ->default($this->getOwnerRecord()->getKey()),
                ])
                ->action(function (array $data): void {
                  //
                }),
        ];
    }
 protected function getActions(): array
    {
        return [
            Action::make('Create')
                ->modal()
                ->form([
                    TextInput::make('name')
                        ->required()
                        ->default('john'),
                ])
                ->action(function (array $data): void {
                    //
                    );

                }),
            Action::make('Generate')
                ->lavel('Regenerate')
                ->modal()
                ->form([
                    TextInput::make('name')
                        ->required()
                        ->default($this->getOwnerRecord()->getKey()),
                ])
                ->action(function (array $data): void {
                  //
                }),
        ];
    }

In blade file:
   @if(method_exists($this, 'headerActions'))
        @foreach($this->getActions()  as $action)
            {{ $action }}
        @endforeach
    @endif
    <x-filament-actions::modals />
   @if(method_exists($this, 'headerActions'))
        @foreach($this->getActions()  as $action)
            {{ $action }}
        @endforeach
    @endif
    <x-filament-actions::modals />

The modals are not open, Is there anything that i missed ?
Screenshot_2025-04-28_at_13.01.08.png
Solution
@dvarilek Thanks for reply,
I just solved it with this ✅
 $this->livewire->cacheAction($action);
 $this->livewire->cacheAction($action);
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

Actions on loop on livewire
FilamentFFilament / ❓┊help
14mo ago
multiple filtersForm on a custom Livewire page
FilamentFFilament / ❓┊help
14mo ago
Livewire websockets on page
FilamentFFilament / ❓┊help
3y ago
Looping through multiple Livewire components containing Filament Action crashes Firefox/Safari
FilamentFFilament / ❓┊help
2y ago