Nova menus provide a convenient way to customize the main and user menus.
dashboards
method within your application’s App\Providers\NovaServiceProvider
class.
Nova will also automatically group your resources under the default “Resources” menu section according to the group
property defined in the Resource
class. In addition, any custom tools you have registered will be listed in the order they are defined within your application’s NovaServiceProvider
.
Nova::mainMenu
method. Typically, this method should be invoked within the boot
method of your application’s App\Providers\NovaServiceProvider
class:
Nova::userMenu
method. This method is typically invoked within the boot
method of your application’s App\Providers\NovaServiceProvider
:
MenuItem
objects. Using MenuSection
or MenuGroup
inside the user menu will throw an Exception
.append
and prepend
methods on a Menu
instance to prepend or append new items to the. These methods are typically most helpful when customizing the user menu, since you often do not want to completely replace the existing menu:
MenuSection::make
method. This method accepts the name of the menu section and array of menu groups / items that should be placed within the section:
path
method when defining the menu section:
MenuSection::dashboard
method:
resource
method to quickly create a link to the appropriate path for a given resource:
lens
method:
collapsable
do not support also being a link. Calling path
on a menu section when it’s collapseable
will result in no link being shown.icon
method when defining the menu section:
icon
method.
withBadge
method on your MenuSection
and specifying the options for the badge:
withBadgeIf
method, you may conditionally add a badge only if a given condition is met:
collapsable
method when defining the menu section. For convenience, Nova will remember the open state for the section between requests:
collapsable
method on the group. For convenience, Nova will remember the open state for the group between requests:
link
factory method on the MenuItem
class:
resource
method to quickly create a link to the appropriate path for a given resource:
filter
method, passing in an instance of the filter and the value it should receive. Since filters can be used with multiple resources, you must also pass a name for the menu item, since it cannot be automatically generated:
User
resource, showing users that have an email ending in @laravel.com
and that also have a status of active
:
make
method:
lens
method:
dashboard
factory method:
externalLink
factory method:
openInNewTab
method on your menu item:
method
helper to pass in the HTTP method, request data, and any HTTP headers that should be sent to your application when the link is clicked. This is typically useful for items like logout links, which should be POST
requests:
withBadge
method on your MenuItem
and specifying the options for the badge:
canSee
method to determine if a menu item should be displayed for the currently authenticated user: