Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jimmitjoo's avatar

Nova resource display in tool

Hi there, I have a nova resource that I want to display in my custom tools navigation so I add a MenuItem::resource for that inside the menu method of my tools serviceprovider. That works fine.

However when I try to hide it from "Resources" navigation by adding public static $displayInNavigation = false; it disappear from my custom tools navigation as well.

How do I display the resource MenuItem inside my tool, but not inside the default "Resources"?

Thanks in advance.

0 likes
1 reply
FTWman's avatar

Maybe a little late answer.

I've achived this goal by overriding native MenuItem class. In new class I excluded availableForNavigation checking. Therefore, any changing of this parameter affects only those menu items, which are instances of unchanged class. And in my custom tool, i put menuitems of my custom class without availableForNavigation checking, and voilà.

 public static function resource($resourceClass)
    {
        return static::make($resourceClass::label())
            ... //
            ->canSee(function ($request) use ($resourceClass) {
                return /*$resourceClass::availableForNavigation($request) && */ $resourceClass::authorizedToViewAny($request); //remove here
            });
    }

Please or to participate in this conversation.