PHP code example of therour / menu-directive
1. Go to this page and download the library: Download therour/menu-directive 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/ */
therour / menu-directive example snippets
'builder' => Therour\MenuDirective\BootstrapMenuBuilder::class,
@sidebarHeading('Heading 1') // output Heading 1
@sidebarMenu([ // Create Menu
'title' => 'Application',
'icon' => 'fas fa-fw fa-cubes',
'url' => '#',
// 'active' => '/' // define your url pattern to match for giving active class
// by default is current url == menu's url will set the menu's class active.
])
@sidebarDropdown([ // Create Dropdown menu
'title' => 'Dropdowns',
'icon' => 'fas fa-fw fa-cubes',
'active' => '/dropdowns/*' // same as menu's active url pattern
], function ($dropdown) {
$dropdown->heading('Heading:'); // add heading inside dropdown
$dropdown->menu(['title' => 'Sub Menu 1', 'url' => url('dropdowns/1')]);
$dropdown->menu(['title' => 'Sub Menu 2', 'url' => url('dropdowns/2')]);
$dropdown->menu(['title' => 'Sub Menu 3', 'url' => url('dropdowns/3')]);
$dropdown->menu(['title' => 'Sub Menu 4', 'url' => url('dropdowns/4')]);
}
)
php artisan vendor:publish --provider="Therour\MenuDirective\MenuDirectiveServiceProvider"