Posts Learn Components Snippets Categories Tags Tools About
/

How to Change Laravel Nova Resource Name

Learn how to change the Laravel Nova resource name on the sidebar to have a friendly resource name

Created on Aug 19, 2021

1865 views

In Laravel Nova you can have a different resource name (located on the sidebar) by updating the static function called "label()" on the resource file.

Tailwind Component Resource


Imagine you have an "ArticleResource" class which by default a default name of "Article", in order to change to a friendly name, you can specify the "label" like below.
<?php

namespace App\Nova;

use Illuminate\Http\Request;

class ArticleResource extends Resource
{
    # your other codes here

    public static function label() {
        return 'All Article';
    }
    
    # your other codes here
}
If you want to know more about the options that are available to you, you can refer to the base "Resource" class which all of the Nova Resource extends to.
app/Nova/Resource.php

If you like our tutorial, do make sure to support us by being our Patreon or buy us some coffee ☕️

Load comments for How to Change Laravel Nova Resource Name

)