2017 © Pedro Peláez
 

library illuminate-menu

A menu builder for Laravel using Bootstrap's markup.

image

kalnoy/illuminate-menu

A menu builder for Laravel using Bootstrap's markup.

  • Friday, February 9, 2018
  • by lazychaser
  • Repository
  • 5 Watchers
  • 20 Stars
  • 2,951 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 4 Forks
  • 1 Open issues
  • 14 Versions
  • 11 % Grown

The README.md

Laravel Menu Builder

A menu builder for Laravel 4-5 using Bootstrap's markup., (*1)

Build Status Latest Stable Version Total Downloads, (*2)

Документация на Русском, (*3)

Note that this package is shipped with no styles nor scripts, you have to download them manually from Twitter Bootstrap's site., (*4)

Installation

Install using Composer:, (*5)

composer require kalnoy/illuminate-menu:~2.0

Add a service provider:, (*6)

'providers' => [
    'Illuminate\Html\MenuServiceProvider',
],

And a facade:, (*7)

'aliases' => [
    'Nav' => 'Illuminate\Support\Facades\Nav',
    'Dropdown' => 'Illuminate\Support\Facades\Dropdown',
],

Documentation

Rendering navigation:, (*8)

{!! Nav::render($items, $attributes) !!}

Where $attributes is optional array of html attributes for ul element., (*9)

Rendering a list of menu items without wrapper element:, (*10)

<ul>{!! Nav::items($items) !!}</ul>

Rendering a single menu item:, (*11)

{!! Nav::item($label, $url) !!}
{!! Nav::item($label, $options) !!}
{!! Nav::item($options) !!}

See a list of available options below., (*12)

Basic example:, (*13)

Nav::render([
    'Link to url' => 'bar',
    'Link to external url' => 'http://bar',
    [ 'label' => 'Link to url', 'url' => 'bar' ],
    'Link to route' => [ 'route' => [ 'route.name', 'foo' => 'bar' ] ],
]);

Rendering an item with a drop down menu:, (*14)

{!! Nav::item([
    'label' => 'Settings',
    'icon' => 'wrench',
    'dropdown' => [
        'Foo' => 'bar',
        '-', // divider
        'Logout' => [ 'route' => 'logout_path' ],
    ],
]) !!}

Controlling whether the item is visible:, (*15)

{!! Nav::item([
    'label' => 'Foo',
    'url' => 'bar',
    'visible' => function () { return Config::get('app.debug'); },
] !!}

Item options

You can specify an array of following options:, (*16)

  • label is a label of the item, automatically translated, so you can specify lang string id
  • href is a raw href attribute on the link
  • url is the url which can be a full URI or local path
  • route to specify a route, possibly with parameters
  • secure; specify true to make url be secure (doesn't affect route option)

Changing the state of the item:, (*17)

  • visible is a boolean value or closure to specify whether the item is visible
  • active is a boolean value or closure to specify whether to add active class to item; if not specified, determined automatically based on current url
  • disabled is a boolean value or closure to specify whether the menu item is disabled

Presentation options:, (*18)

  • icon is a glyphicon id, i.e. pencil
  • badge is a value for badge (scalar or closure)
  • and any other parameter that will be rendered as an additional attribute for link element.
  • dropdown is a collection of items for drop down menu

Customization

Though this menu builder intended to be used together with bootstrap markup, you can customize it however you like by extending Illuminate\Html\MenuBuilder class and overriding base methods., (*19)

The Versions

09/02 2018

v1.x-dev

1.9999999.9999999.9999999-dev

A menu builder for Laravel using Bootstrap's markup.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Alexander Kalnoy

laravel bootstrap menu

09/02 2018

v1.3.2

1.3.2.0

A menu builder for Laravel using Bootstrap's markup.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Alexander Kalnoy

laravel bootstrap menu

06/02 2018

v1.3.1

1.3.1.0

A menu builder for Laravel using Bootstrap's markup.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Alexander Kalnoy

laravel bootstrap menu

22/12 2015

1.x-dev

1.9999999.9999999.9999999-dev

A menu builder for Laravel using Bootstrap's markup.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Alexander Kalnoy

laravel bootstrap menu

22/12 2015

v1.3.0

1.3.0.0

A menu builder for Laravel using Bootstrap's markup.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Alexander Kalnoy

laravel bootstrap menu

12/12 2015

dev-master

9999999-dev

A menu builder for Laravel using Bootstrap's markup.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Alexander Kalnoy

laravel bootstrap menu

26/09 2015

v1.2.0

1.2.0.0

A menu builder for Laravel using Bootstrap's markup.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Kalnoy

laravel bootstrap menu

05/08 2015

v1.1.2

1.1.2.0

A menu builder for Laravel using Bootstrap's markup.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Kalnoy

laravel bootstrap menu

10/06 2015

v1.1.1

1.1.1.0

A menu builder for Laravel using Bootstrap's markup.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Kalnoy

laravel bootstrap menu

15/04 2015

v1.1.0

1.1.0.0

A menu builder for Laravel using Bootstrap's markup.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Kalnoy

laravel bootstrap menu

08/02 2015

v1.0.3

1.0.3.0

A menu builder for Laravel using Bootstrap's markup.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Kalnoy

laravel bootstrap menu

05/02 2015

v1.0.2

1.0.2.0

A menu builder for Laravel using Bootstrap's markup.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Kalnoy

laravel bootstrap menu

20/01 2015

v1.0.1

1.0.1.0

A menu builder for Laravel using Bootstrap's markup.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Kalnoy

laravel bootstrap menu

16/01 2015

v1.0.0

1.0.0.0

A menu builder for Laravel using Bootstrap's markup.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Kalnoy

laravel bootstrap menu