© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
9 replies
RuiAlmeida

How to pass data to an EditAction

I'm struggling to make the editAction to recieve the record where I call the action in the livewire blade component

In blade i have :
 {{ ($this->editAction)(['record' => $menu]) }}
 {{ ($this->editAction)(['record' => $menu]) }}


component:
 class MenuComponent extends Component implements HasForms
       public function editAction(): Action
    {
        return
            Action::make('edit')
                ->fillForm(fn(ButteryMenu $record): array => [
                    
                    'title'       => $record->title,
                     ...
                ])
                ->form(ButteryMenuResource::getFormSchema())
                
                ->action(function (array $data, array $arguments): void {
                    $record = ButteryMenu::find($arguments['record']->id);
                    $record->update($data);
                    $this->dispatch('buttery-menu-saved');
                });
    }
 class MenuComponent extends Component implements HasForms
       public function editAction(): Action
    {
        return
            Action::make('edit')
                ->fillForm(fn(ButteryMenu $record): array => [
                    
                    'title'       => $record->title,
                     ...
                ])
                ->form(ButteryMenuResource::getFormSchema())
                
                ->action(function (array $data, array $arguments): void {
                    $record = ButteryMenu::find($arguments['record']->id);
                    $record->update($data);
                    $this->dispatch('buttery-menu-saved');
                });
    }

Do i need anything in the mount() ?
(I have a similar createAction in the compoenent that's working fine
)
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

Pass data to widget
FilamentFFilament / ❓┊help
3y ago
pass data to blade
FilamentFFilament / ❓┊help
3y ago
How to pass form data when using replaceMountedAction()
FilamentFFilament / ❓┊help
2y ago
How to pass data into a filament page?
FilamentFFilament / ❓┊help
2y ago