Reputation: 81
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:
I tried to comment out the entire contents of the views / resources / navigation.blade.php file
I tried to comment out the new line calling "new ResourceManager" inside registerTools in src / NovaServiceProvider.php.
So far, all without results.
Upvotes: 4
Views: 7362
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
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