We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
The sortBy method sorts the menu items by the given key:
sortBy
Menu::make('example', function(Builder $menu) { $menu->add('Blog', 'blog')->data('order', 3); $menu->add('Contact', 'contact')->data('order', 4); $menu->add('About', 'about')->data('order', 2); $menu->add('Home', '/')->data('order', 1); })->sortBy('order');
The above example will sort your menu items by the order meta data in ascending order.
order
The sortByDesc method has the same signature as the sortBy method, but will sort the menu items in the opposite order.
sortByDesc