1. Go to this page and download the library: Download adel/laravel-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/ */
adel / laravel-menu example snippets
return [
//'template' => 'menu.menu', // custom blade template can be provided here
'items' => [
[
'name' => 'Home',
'link' => route('dashboard'),
'active' => activeMenuController(\App\Http\Controllers\DashboardController::class),
'icon' => 'home',
],
[
'name' => 'Users',
'auth' => authMenuCan('manageUsers'), // Will be shown if user "can" 'manageUsers'.
// Gate::check('manageUsers') will be checked
'link' => '/users',
'active' => activeMenuUrlPrefix('users'), // Will be active for all '/users*' URL's
'icon' => 'user',
],
[
'name' => trans('complex.auth'),
'auth' => function (){
return Gate::check('one') || Gate::check('two');
},
'link' => '/complex-auth',
'active' => activeMenuUrlPrefix('complex-auth'),
'icon' => 'complex',
],
[
'name' => 'Group',
'icon' => 'group',
'items' => [
[
'name' => 'Orders',
'link' => '/orders', // route('orders'),
'active' => activeMenuController(\App\Http\Controllers\OrdersController::class),
'icon' => 'orders',
],
[
'name' => 'Bar',
'link' => '/bar', // route('bar'),
'active' => activeMenuController(\App\Http\Controllers\BarController::class),
'icon' => 'bar',
],
],
],
],
];