Customize "create :resource" button label
Morning, I'd like to change the "create :resource" label to "register :resource" on my list page. I've been checking the docs but I can't find the right place to do it.
I have tried to add this in the
ListMovements.php
page (my resource is called MovementResource
) but I haven't been lucky:
Thanks in advance.16 Replies
Does this work for you?
protected static ?string $modelLabel = 'whatever';
Yes, but that customs only the resource name (displayed in the sidebar). So the button is now "Create whatever"
What I'd like to do is rename the whole button label to "Register whatever" instead
you want to overrdide other UI elements?
No, just the create button label text
ahh you want to change the word "create" ?
yes
ok
@kennyhorna Go to the ListMovimientos.php and add
->label('Register Movimiento')
to the make function@TheRealTeeHill that's what I did but it doesn't work (see the snippet in the question)
your code is
getActions()
when you need getHeaderActions()
Ah my bad
easy mistake to make π
So, it didn't work before cause the method was already defined (I generated the resource with Laravel idea.
Anyway, thank you @TheRealTeeHill π Have a nice day
no worries, got the result in the end, all the best, please mark my answer as solved β€οΈ