F
Filament•6mo ago
Itachi

How modify create button label

I would like to rename the 'Create' button to 'Submit'. How can I achieve that, sir?
Solution:
You can override getCreateFormAction on the Create page class
Jump to solution
12 Replies
Itachi
Itachi•6mo ago
public static function createButtonLabel() { return 'YourButtonTextHere'; } this function didnot work
toeknee
toeknee•6mo ago
->label('Create') on the button it'sself within the list page?
Itachi
Itachi•6mo ago
sir in resources file create button it show Method Filament\Forms\Form::label does not exist. this error
toeknee
toeknee•6mo ago
You haven't applied it to the Action. You put it on the form... the action likely sits in the listpage class
Itachi
Itachi•6mo ago
Sir, I have not created any action buttons. Filament provides default buttons such as 'Create,' 'Create and Create Another,' and 'Cancel' on the create page. I would like to rename the 'Create' button to 'Save.'
Itachi
Itachi•6mo ago
No description
toeknee
toeknee•6mo ago
So this is within the page iteself, you can do it globally with a language override?
Itachi
Itachi•6mo ago
Sir, I just want to modify that on a specific page, not on every page.
Dennis Koch
Dennis Koch•6mo ago
Just apply it to the one button on the specific page then
Solution
ConnorHowell
ConnorHowell•6mo ago
You can override getCreateFormAction on the Create page class
ConnorHowell
ConnorHowell•6mo ago
Here's the default one:
protected function getCreateFormAction(): Action
{
return Action::make('create')
->label(__('filament-panels::resources/pages/create-record.form.actions.create.label'))
->submit('create')
->keyBindings(['mod+s']);
}
protected function getCreateFormAction(): Action
{
return Action::make('create')
->label(__('filament-panels::resources/pages/create-record.form.actions.create.label'))
->submit('create')
->keyBindings(['mod+s']);
}
Itachi
Itachi•6mo ago
thank you,everyoneđź‘Ť