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();
    })


But the submit button never resolves
image.png
Was this page helpful?