F
Filament13mo ago
skpi4u

remove/hide cancel button from create/edit resources

How can we remove the cancel button
6 Replies
Dennis Koch
Dennis Koch13mo ago
Overwrite the getFormActions method on the create/edit page.
skpi4u
skpi4u13mo ago
protected function getFormActions(): array { return [$this->getCancelFormAction()];
}
Dennis Koch
Dennis Koch13mo ago
?
hdaklue
hdaklue13mo 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
skpi4u13mo ago
@hdaklue this create a new save button, i want to hide cancel button
hdaklue
hdaklue13mo 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
More Posts
Passing data to custom page through table action.Hi, I'm trying to pass the current record to a custom page on a table action, however I can't seem tIssue with getEloquentQuery, query and ActionI am doing this in a resource, it works good but for example if it is filtering $filter_stock = requUndefined variable $table while using table builderFollowing this tutorial: https://filamentphp.com/docs/2.x/tables/getting-started#preparing-your-liveFileUpload display order changeHello, when I use FileUpload with multiple images after it saves and I refresh the page it is showinOpen a Edit Page from Widgets through Dashboard ViewI'm trying to open the selected data from a Dashboard to the Edit page of the fetched data . I've bemultiple resources with the same policy leads to unwanted action when used with roles and permissionhey, can i somehow override the can method inside resource class to make the resource use different How to use a Checkbox to edit fields in a related modelI've got a simple has-one relationship in my `User` model which relates to a `UserFeatures` model, Display value of Pivot TableHello, I'm currently looking for a better and more performant solution to display a pivot table attPosting data from one page to another with a formHi - What I wanna do is post data from one custom page to another via POST-Request. Right now I faceHow to remove form action from resource modal?I want to remove the default form actions Save Changes and Cancel from the Resource Modal when using