Resource badge should be visible when including a resource via the MenuItem #4603
-
Description:I've had to resort to building out the menu fully custom because I wanted more control over the ordering of groups. My menu is now fully working. But as a result of doing this, I've lost all my badges that I already setup inside each resource file using this syntax:
When resolving a resource like this:
If that Nova Resource already has a badge setup using the above I know that I can use
So it would be great if you could simply use the badge that is already setup in the resource class. I consider this more of a bug than a feature request. Many thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It's not a bug. If you don't use the If you want to use the menu item from the resource itself with its badge logic, you can just call it inside your NovaServiceProvider: Nova::mainMenu(function (Request $request) {
return [
Resource::make()->menu($request),
];
}); |
Beta Was this translation helpful? Give feedback.
It's not a bug. If you don't use the
menu
method on the resource itself to display the menu item, and instead use a static constructor from theMenuItem
class then you're opting to build your own instance.If you want to use the menu item from the resource itself with its badge logic, you can just call it inside your NovaServiceProvider: