remove/hide cancel button from create/edit resources

How can we remove the cancel button
6 Replies
Dennis Koch
Dennis Koch2y ago
Overwrite the getFormActions method on the create/edit page.
skpi4u
skpi4uOP2y ago
protected function getFormActions(): array { return [$this->getCancelFormAction()];
}
Dennis Koch
Dennis Koch2y ago
?
hdaklue
hdaklue2y ago
protected function getFormActions(): array
{
return [
\Filament\Pages\Actions\Action::make('save')
->submit()
->label('Save'),
];
}
protected function getFormActions(): array
{
return [
\Filament\Pages\Actions\Action::make('save')
->submit()
->label('Save'),
];
}
skpi4u
skpi4uOP2y ago
@hdaklue this create a new save button, i want to hide cancel button
hdaklue
hdaklue2y ago
It does the same task as it overrides the original form. DD(parent::getFormActions() then Arr::except() but it's the long way.
Want results from more Discord servers?
Add your server