Posts Learn Components Snippets Categories Tags 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

21 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

Snippets by

PostSrc poster

PostSrc

Full stack developer mainly focusing on the front end side of the web. The main author of PostSrc and loves writing tutorial and guides online.

Load comments for How to Change Laravel Nova Resource Name

new

PostSrc Code Components

Collection of Tailwind CSS components for everyone to use. Browse all of the components that's right for your project.

View Components

Other Code Snippets

More