F
Filamentβ€’15mo ago
ehbfa

Form action location

Hi, I've got the default DeleteAction in my getActions method of the Edit page. But is there some way to set the position of this action, so it is on the same row as the normal buttons for submit and cancel?
2 Replies
LeandroFerreira
LeandroFerreiraβ€’15mo ago
not sure if this is the best way to do it:
protected function getFormActions(): array
{
return [
$this->getSaveFormAction(),
$this->getCancelFormAction(),
Action::make('delete')
->color('danger')
->requiresConfirmation()
->action(function () {
$this->delete();
}),
];
}
protected function getFormActions(): array
{
return [
$this->getSaveFormAction(),
$this->getCancelFormAction(),
Action::make('delete')
->color('danger')
->requiresConfirmation()
->action(function () {
$this->delete();
}),
];
}
ehbfa
ehbfaβ€’15mo ago
Not sure either, but it works - that's the good part πŸ˜… Thanks @Leandro Ferreira Only thing is the action, calling $this->delete is deprecated, I had to change it to: ->action('delete')