PHP code example of kalnoy / illuminate-menu

1. Go to this page and download the library: Download kalnoy/illuminate-menu library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

kalnoy / illuminate-menu example snippets


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

'aliases' => [
    'Menu' => 'Illuminate\Support\Facades\Menu',
],

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

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

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

Menu::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' ] ],
]);

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

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