Change the default "save and create another" label in modal form
Hello all 👋,
I have a resource (MarketingMessage) for which I removed the default pages
CreateMarketingMessage.php
and EditMarketingMessage.php
to have Modals instead.
So, in my resource's getPages()
method, I have just one value in the return array:
Everything works fine, but I wanted to know which method I should use (and where) to change the default label of “Create & add another”. Because in French, I have to change the translation to use a feminine form.
I saw that there was a getCreateAnotherFormAction()
method to use in CreateMarketingMessage.php, but since I don't use that page, it's no good.
Can anyone help me? I couldn't find a reference in the documentation.
Thanks in advance 😇7 Replies
You've to apply this on
CreateAction
in ListRecordThanks for your answer.
In where method should I put this?
I can't find something related in the base ListRecords.php file.
I tried to use this method, but I don't think is the good one because nothing change :
Like this
Solution
What I show you is literally a copy/paste from this line https://github.com/filamentphp/filament/blob/3.x/packages/actions/src/CreateAction.php#L40
Thanks you, that it!
So, what I did is put that on the
getHeaderActions()
method in my List resource page :
Thanks you for your help 🙂