Skip to content
Shea Lewis edited this page Nov 16, 2015 · 1 revision

Basic Usage

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.

Descending Order

The sortByDesc method has the same signature as the sortBy method, but will sort the menu items in the opposite order.

Table of Contents
  1. Home
  2. Installation
  3. Quick Start

Getting Started

Usage
Clone this wiki locally