Andrey  Markov
Andrey Markov

Reputation: 81

Laravel Nova remove resources from navigation

Perhaps someone has already encountered a similar problem and can tell me.

How to delete “resources” item in navigation. Not a separate resource - but in general, completely remove the entire list, including the title.

Screenshot: https://prnt.sc/lw1nup

Need to: https://prnt.sc/lw1xf9

What I was trying to do:

So far, all without results.

Upvotes: 4

Views: 7362

Answers (2)

user10808726
user10808726

Reputation:

Another way to hide a resource from resource list is by adding the below code in your resource file:

public static $displayInNavigation = false;

That I wish we had it in the document as well.

Upvotes: 9

Saumini Navaratnam
Saumini Navaratnam

Reputation: 8850

As of v1.2.0 there is a function availableForNavigation in Laravel\Nova\Resource which returns true.

You can override that function to return false in App\Nova\Resource abstract class.

/**
 * Determine if this resource is available for navigation.
 *
 * @param  \Illuminate\Http\Request  $request
 * @return bool
 */
public static function availableForNavigation(Request $request)
{
    return false;
}

Upvotes: 5

Related Questions