Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

kokarat's avatar

How to custom button text on resources

I need to custom text on the button I possible to do that?

eg. Create Post, Update Post, Update and Continue Editing

0 likes
5 replies
Vilfago's avatar

Yes

<button>Your custom text</button>

But I wonder if it was really your question :) Could you be more specific, with some code you already have ?

JackShev's avatar

I had the same problem because I needed more complicated translations. Unfortunately, this can not be done without changes in the source code.

Example: nova/resources/js/views/Update.vue

<progress-button
    dusk="update-button"
    type="submit"
    :disabled="isWorking"
    :processing="submittedViaUpdateResource"
>
    {{ __('Update') }} {{ singularName }}
</progress-button>

singularName can be modified in Your resource class by using function:

public static function singularLabel() {
    return 'my_custom_text'
}
ijklim's avatar

In the resource file customize the updateButtonLabel function

Example: app/Nova/Post.php

/**
 * Get the text for the update resource button.
 *
 * @return string|null
 */
public static function updateButtonLabel()
{
    return 'Save';
}

Please or to participate in this conversation.