Home / Snippets / How to Change Laravel Nova Resource Name
How to Change Laravel Nova Resource Name cover

How to Change Laravel Nova Resource Name

1.9K

3 years ago

0 comments

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
notion avatar

Alaz

Week-end developer currently experimenting with web, mobile, and all things programming.

Topics:

Frontend

Resource

Average

Average

Support Us

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

Welcome to PostSrc V3

PostSrc Dark Logo

You have to login to favorite this