-
Notifications
You must be signed in to change notification settings - Fork 60
Sorting
kai edited this page Feb 13, 2020
·
1 revision
The sortBy method sorts the menu items by the given key:
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.
The sortByDesc method has the same signature as the sortBy method, but will sort the menu items in the opposite order.
🔴 Best Temporary Email - https://1secmail.ru 🔴