I am upgrading Custom Tool from Nova 3 to Nova 4. We have our Navigation menu populated from renderNavigation() method of Tool class.
Now I understand, we have to use menu() instead. So:
public function menu(Request $request)
{
return MenuSection::make('Section')
->path('/resources/foo')
->icon('server');
}
Above works. It works even when I use MenuGroup and MenuItem
But doesn't work, when I use resource
MenuSection::make('Section', [
MenuGroup::make('Bar', [
MenuItem::resource(Foo::class),
]),
])
In resource, I have these property set:
/**
* The logical group associated with the resource.
*
* @var string
*/
public static $group = 'Bar';
/**
* This resource is not displayed in navigation
*/
public static $displayInNavigation = true;
Any guesses where am I going wrong? I don't get any errors in console or error log file.