How to validate a single field when using a form action?

Is there a way to validate a single field inside a form action?

I tried to validate the field keywords, but it didn't work:

TextInput::make('keywords')
                                        ->required()
                                        ->maxLength(255)
                                        ,
                                    Filament\Forms\Components\Actions::make([
  Filament\Forms\Components\Actions\Action::make('generate')
                                            ->action(function () {
  $this->validateOnly('keywords');

})
Was this page helpful?