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
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 ?
@SNAPEY - Button which are created from nova resource
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'
}
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.