Platform Menu

The platform panel menu is an important element of the graphical user interface because it is the main navigation through the project.

In order to add a new item to the menu, you need to inform our application Dashboard. To do this, call the method in the menu properties and pass arguments:

  • The name of the menu to which you want to attach the item
  • A menu object is containing the name, links, etc.


The default menu registration takes place in the app/Orchid/PlatformProvider.php:

namespace App\Orchid;

use Orchid\Platform\ItemMenu;
use Orchid\Platform\OrchidServiceProvider;

class PlatformProvider extends OrchidServiceProvider
    // ...

    public function registerMainMenu(): array
        return [

The methods registerMainMenu, registerProfileMenu, and registerSystemMenu must return the menu items that are required to be displayed.


Let's look at an example. Initially we create an ItemMenu object, setting various parameters, and then add the item to a specific place. There are several such places:

  • registerMainMenu - The menu is displayed on each page on the left side.
  • registerSystemMenu - The menu that forms the navigation on the system page.
  • registerProfileMenu - The menu displayed when you click on the profile.


Basic use:

use Orchid\Platform\ItemMenu;


Note. for each element during creation, the unique key which cannot repeat is generated, but it can be changed manually by means of the slug method.

Setting Links

Reference Reference:


Specifying a link through the route:


To determine the link activity, use the dwightwatson/active package Link activity, when using route andurl is set automatically, but it is acceptable to change with the help of explicit instructions:





Quite an expected situation when some links should be missing depending on the availability of rights or other circumstances, for this:


or any other check returning a boolean value:



For a menu item, you can specify a graphic icon with:


It is also possible to integrate into a visual group by setting the title for the first element:


Display order

Sorting set by setting the sequence number:


Badge notifications

Menu items have the ability to notify the user about any events in the form of a numerical value, for this:

    ->badge(function () {
        return 10;

Nested menu

To be able to create a submenu, you need to add the main item and specify its unique name using the slug method, then you can add other elements to the new item.

ItemMenu::label('My menu')

ItemMenu::label('Sub element')

When the children have different display rules, so as not to list them all in the parent, you can use the hiddenEmpty method. He will hide it when the subitems are unavailable:

ItemMenu::label('Dropdown menu')

ItemMenu::label('Sub element item 1')

ItemMenu::label('Sub element item 2')