How to reorder button on edit resource
Is it possible to reorder buttons on edit reource that mine primary button is right and cancel button is left
Solution:Jump to solution
Very quick and simple way would be to edit the EditPage.php
and add:
```php...
20 Replies
I would like to look like on the picture bellow
Solution
Very quick and simple way would be to edit the EditPage.php
and add:
Thanks man it works :fi:
Do you maybe know how i can rename the save text button i try with
in "getFormActions()" you can pass manually an array of actions. just put manually the CancelAction::make() and SaveAction::make()->label('new text')
what is the namespace for the CancelAction and SaveAction
do it like this:
I get the error for the cancel()
which error
just these and then mark cancel function
are you in the EditPage?
app/Filament/Resources/MineResource/Pages/EditResource.php
this is mine path where i paste your code
my fault,
->cancel()
is only for modalActions, I think..
do this, it works:
or:
Just replace the actions with a clone of the save and cancel actions...
This solution works for me. Thank you all
And you @toeknee thanks
Does anyone knows how i can reorder the buttons on the modal
What is it you want to do? exactly? You can clone the default action buttons and add them in
To swap these button the button create must be last, cancel button first mine code is
Ahh on a selection I am not sure, but in an edit page etc you would tend to use:
protected function getFormActions(): array
{
return array_reverse(parent::getFormActions());
}