© 2026 Hedgehog Software, LLC

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

Actions button omit stating `->action(function_name)`

the question is, is it possible to omit stating
->action(function_name)
->action(function_name)
and have the function called automatically? is it not possible or I missed out in the doc

very often I have action buttons in page/form and is defined as below
protected function getFormActions(): array
{
    return [
        $this->getSaveFormAction(),
        Action::make('approve')
            ->action('approve'),
        Action::make('reject')
            ->action('reject')
    ];
}
protected function getFormActions(): array
{
    return [
        $this->getSaveFormAction(),
        Action::make('approve')
            ->action('approve'),
        Action::make('reject')
            ->action('reject')
    ];
}


and have the functions defined as
public function approve()
{
  //
}

public function reject()
{
  //
}
public function approve()
{
  //
}

public function reject()
{
  //
}
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

Call Component function from Action button
FilamentFFilament / ❓┊help
3y ago
Actions Button
FilamentFFilament / ❓┊help
2y ago
Action button
FilamentFFilament / ❓┊help
16mo ago
underscore action name
FilamentFFilament / ❓┊help
2y ago