PHPackages                             jaapmoolenaar.nl/laravel-menu - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. jaapmoolenaar.nl/laravel-menu

AbandonedLibrary[Utility &amp; Helpers](/categories/utility)

jaapmoolenaar.nl/laravel-menu
=============================

A quick way to create menus in Laravel 5

5.6(8y ago)061MITPHPPHP &gt;=5.3.0

Since Jul 15Pushed 8y ago1 watchersCompare

[ Source](https://github.com/JaapMoolenaar/laravel-menu)[ Packagist](https://packagist.org/packages/jaapmoolenaar.nl/laravel-menu)[ Docs](https://github.com/lavary/laravel-menu)[ RSS](/packages/jaapmoolenaarnl-laravel-menu/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (5)Dependencies (2)Versions (21)Used By (0)

Laravel Menu
============

[](#laravel-menu)

[![Latest Stable Version](https://camo.githubusercontent.com/e780eec5940cc23da1bb6a09329a135efb0c35dc0ae60bbab5681c9b573ec9d0/68747470733a2f2f706f7365722e707567782e6f72672f6a6161706d6f6f6c656e6161722e6e6c2f6c61726176656c2d6d656e752f762f737461626c65)](https://packagist.org/packages/jaapmoolenaar.nl/laravel-menu)[![Total Downloads](https://camo.githubusercontent.com/0e23fd24bd9c9281c6f3f257e13c0292499753b15c5f8f3edcbe230da043848c/68747470733a2f2f706f7365722e707567782e6f72672f6a6161706d6f6f6c656e6161722e6e6c2f6c61726176656c2d6d656e752f646f776e6c6f616473)](https://packagist.org/packages/jaapmoolenaar.nl/laravel-menu)[![Latest Unstable Version](https://camo.githubusercontent.com/bcf8fe01e706863103bc6beb192aacd91296198b2750768df18873e9d40cd8ff/68747470733a2f2f706f7365722e707567782e6f72672f6a6161706d6f6f6c656e6161722e6e6c2f6c61726176656c2d6d656e752f762f756e737461626c65)](https://packagist.org/packages/jaapmoolenaar.nl/laravel-menu)[![License](https://camo.githubusercontent.com/f455ce1dc6824c5749f8de76004845f3a0feeecf4f71b662e062b938cf260fba/68747470733a2f2f706f7365722e707567782e6f72672f6a6161706d6f6f6c656e6161722e6e6c2f6c61726176656c2d6d656e752f6c6963656e7365)](https://packagist.org/packages/jaapmoolenaar.nl/laravel-menu)

A quick way to create menus in [Laravel 5](http://laravel.com/)

**For Laravel 4.x, check [version 1.5.0](https://github.com/lavary/laravel-menu/tree/v1.5.0)**

\##Documentation

- [Installation](#installation)
- [Getting Started](#getting-started)
- [Routing](#routing)
    - [URLs](#urls)
    - [Named Routes](#named-routs)
    - [Controller Actions](#controller-actions)
    - [HTTPS](#https)
- [Sub-items](#sub-items)
- [Set Item's ID Manualy](#)
- [Set Item's Nicknames Manualy](#)
- [Referring to Items](#referring-to-items)
    - [Get Item by Title](#get-item-by-title)
    - [Get Item by Id](#get-item-by-id)
    - [Get All Items](#get-all-items)
    - [Get the First Item](#get-the-first-item)
    - [Get the Last Item](#get-the-last-item)
    - [Get Sub-items of the Item](#get-sub-items-of-the-item)
    - [Magic Where Methods](#magic-where-methods)
- [Referring to Menu Objects](#referring-to-menu-instances)
- [HTML Attributes](#html-attributes)
- [Manipulating Links](#manipulating-links)
    - [Link's Href Property](#links-href-property)
- [Active Item](#active-item)
    - [RESTful URLs](#restful-urls)
    - [URL Wildcards](#url-wildcards)
- [Inserting a Separator](#inserting-a-separator)
- [Append and Prepend](#append-and-prepend)
- [Raw Items](#raw-items)
- [Menu Groups](#menu-groups)
- [URL Prefixing](#url-prefixing)
- [Nested Groups](#nested-groups)
- [Meta Data](#meta-data)
- [Filtering the Items](#filtering-the-items)
- [Sorting the Items](#sorting-the-items)
- [Rendering Methods](#rendering-methods)
    - [Menu as Unordered List](#menu-as-unordered-list)
    - [Menu as Ordered List](#menu-as-ordered-list)
    - [Menu as Div](#menu-as-div)
    - [Menu as Bootstrap 3 Navbar](#menu-as-bootstrap-3-navbar)
- [Advanced Usage](#advanced-usage)
    - [A Basic Example](#a-basic-example)
    - [Control Structure for Blade](#control-structure-for-blade)
        - [@lm-attrs](#lm-attrs)
- [Configuration](#configuration)
- [If You Need Help](#if-you-need-help)
- [License](#license)

Installation
------------

[](#installation)

In the `require` key of `composer.json` file, add `lavary/laravel-menu": "dev-master`:

```
...
"require": {
	"laravel/framework": "5.1.*",
	"lavary/laravel-menu": "dev-master"
  }

```

Run the `composer update` command:

```
composer update
```

Now, append Laravel Menu service provider to `providers` array in `config/app.php`.

```

```

At the end of `config/app.php` add `'Menu'    => 'Lavary\Menu\Facade'` to the `$aliases` array:

```

```

This registers the package with Laravel and creates an alias called `Menu`.

Getting Started
---------------

[](#getting-started)

You can define the menu definitions inside a [laravel middleware](http://laravel.com/docs/master/middleware). As a result anytime a request hits your application, the menu objects will be available to all your views.

Here is a basic usage:

```
