F
Filamentβ€’2y 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β€’2y 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
ehbfaOPβ€’2y 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')
Want results from more Discord servers?
Add your server