© 2026 Hedgehog Software, LLC

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

Actions\Action not calling the action method when combined with form

I'm trying to create a custom form that executes a custom action after submitting but the method action is never called.

use Filament\Actions;
use Filament\Forms;

Actions\Action::make('add_role')
    ->label('Assign role')
    ->color('info')
    ->visible(fn () => Auth::user()->is_system_admin || Auth::user()->is_back_officer)
    ->form(function (User $record) {
        $options = static::getRoleOptions($record);
  
        return [
            Forms\Components\Select::make('role')
                ->label('Role')
                ->options($options)
                ->native(false)
                ->required(),
  
            Forms\Components\Group::make()
                ->schema(fn (Get $get) => match ($get('role')) {
                    'guest' => [],
                    default => []
                }),
        ];
    })
    ->action(function () {
        Notification::make()
            ->success()
            ->title('New role assigned successfully.')
            ->send();
    })
use Filament\Actions;
use Filament\Forms;

Actions\Action::make('add_role')
    ->label('Assign role')
    ->color('info')
    ->visible(fn () => Auth::user()->is_system_admin || Auth::user()->is_back_officer)
    ->form(function (User $record) {
        $options = static::getRoleOptions($record);
  
        return [
            Forms\Components\Select::make('role')
                ->label('Role')
                ->options($options)
                ->native(false)
                ->required(),
  
            Forms\Components\Group::make()
                ->schema(fn (Get $get) => match ($get('role')) {
                    'guest' => [],
                    default => []
                }),
        ];
    })
    ->action(function () {
        Notification::make()
            ->success()
            ->title('New role assigned successfully.')
            ->send();
    })


But the submit button never resolves
image.png
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

Action calling a method problem
FilamentFFilament / ❓┊help
2y ago
Form\Actions\Action call javascript?
FilamentFFilament / ❓┊help
3y ago
Form Actions\Action everything null
FilamentFFilament / ❓┊help
3y ago
Live method is calling mine action
FilamentFFilament / ❓┊help
2y ago