-
Notifications
You must be signed in to change notification settings - Fork 233
Sort By
Shea Lewis edited this page Nov 16, 2015
·
1 revision
The sortBy
method sorts the menu items by the given key:
Menu::make('example', function($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.
The sortByDesc
method has the same signature as the sortBy
method, but will sort the menu items in the opposite order.
- Active Link Detection
- Append and Prepend
- Attributes
- Dividers
- [Meta Data](Meta Data)
- [Sort By](Sort By)