F
Filament•12mo 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
ItachiOP•12mo ago
public static function createButtonLabel() { return 'YourButtonTextHere'; } this function didnot work
toeknee
toeknee•12mo ago
->label('Create') on the button it'sself within the list page?
Itachi
ItachiOP•12mo ago
sir in resources file create button it show Method Filament\Forms\Form::label does not exist. this error
toeknee
toeknee•12mo ago
You haven't applied it to the Action. You put it on the form... the action likely sits in the listpage class
Itachi
ItachiOP•12mo 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
ItachiOP•12mo ago
No description
toeknee
toeknee•12mo ago
So this is within the page iteself, you can do it globally with a language override?
Itachi
ItachiOP•12mo ago
Sir, I just want to modify that on a specific page, not on every page.
Dennis Koch
Dennis Koch•12mo ago
Just apply it to the one button on the specific page then
Solution
ConnorHowell
ConnorHowell•12mo ago
You can override getCreateFormAction on the Create page class
ConnorHowell
ConnorHowell•12mo 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
ItachiOP•12mo ago
thank you,everyoneđź‘Ť
Want results from more Discord servers?
Add your server