F
Filament9mo ago
Tritus

Change text for buttons "Create" and remove "Create and create another"

Hi everyone, I was pretty sure to have found it the documentation a time ago, but I am not able to see it again. I'm trying to change the label for the "Create" button (replace it with "Save") for Create and Edit pages, and I want to remove the "Create and create another" on the Create page. Can someone help me? Thanks a lot!
8 Replies
Strategic
Strategic9mo ago
you need to publish translations : php artisan vendor:publish --tag=filament-panels-translations and go to /lang/vendor/filament-panels/en/resources/pages/create-record.php
Tritus
Tritus9mo ago
Thanks @Strategic, I was able to change "Create" to "Save". However, I'm not able to completely remove the "Create & create another" button I found With $canCreateAnother Thanks for your help! Everything's solved!
Strategic
Strategic9mo ago
when you publish configuration you can change this file e /lang/vendor/filament-panels/en/resources/pages/create-record.php 'form' => [ 'actions' => [ 'cancel' => [ 'label' => 'Cancel', ], 'create' => [ 'label' => 'Save', ], /* remove this 'create_another' => [ 'label' => 'Save & add another', ],*/ ], ],
Tritus
Tritus9mo ago
I removed it, but the button was still here
Strategic
Strategic9mo ago
No wories Yes .. sorry i am tired.. its for labels it will not remove button ..
Tritus
Tritus9mo ago
No issues, take time to rest a little! ;). Important to keep us in good health
krekas
krekas9mo ago
Overwrite actions then
Strategic
Strategic9mo ago
yes on the create resource page add this line
class CreateYourResourceName extends CreateRecord { protected static bool $canCreateAnother = false; }