2020-03-10 17:06:10 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Middleware;
|
|
|
|
|
|
|
|
use Closure;
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
use Lavary\Menu\Builder;
|
|
|
|
use Lavary\Menu\Menu;
|
|
|
|
|
|
|
|
class GenerateMenus
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Handle an incoming request.
|
|
|
|
*
|
|
|
|
* @param Request $request
|
|
|
|
* @param Closure $next
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function handle($request, Closure $next)
|
|
|
|
{
|
|
|
|
(new Menu)->make('menu', function (Builder $menu) {
|
|
|
|
$accueil = $menu->add('Accueil', ['route' => 'dashboard', 'class' => 'nav-item'])->nickname('home');
|
|
|
|
$accueil->link->attr(['class' => 'nav-link']);
|
|
|
|
$accueil->prepend('<i class="fe fe-home"></i> ');
|
|
|
|
$accueil->checkActivationStatus();
|
|
|
|
|
|
|
|
$stats = $menu->add('Mes statistiques', ['route' => 'stats', 'class' => 'nav-item'])->nickname('stats');
|
|
|
|
$stats->link->attr(['class' => 'nav-link']);
|
|
|
|
$stats->prepend('<i class="fe fe-trending-up"></i> ');
|
|
|
|
$stats->checkActivationStatus();
|
|
|
|
|
2020-03-18 16:57:32 +01:00
|
|
|
$calendar = $menu->add('Mon calendrier', ['route' => ['calendar', 'month'], 'class' => 'nav-item'])->nickname('calendar');
|
|
|
|
$calendar->link->attr(['class' => 'nav-link']);
|
|
|
|
$calendar->prepend('<i class="fe fe-calendar"></i> ');
|
|
|
|
$calendar->checkActivationStatus();
|
|
|
|
|
2020-03-10 17:06:10 +01:00
|
|
|
$gallery = $menu->add('Ma gallerie', ['route' => 'gallery', 'class' => 'nav-item'])->nickname('gallery');
|
|
|
|
$gallery->link->attr(['class' => 'nav-link']);
|
|
|
|
$gallery->prepend('<i class="fe fe-image"></i> ');
|
|
|
|
$gallery->checkActivationStatus();
|
|
|
|
});
|
|
|
|
|
|
|
|
return $next($request);
|
|
|
|
}
|
|
|
|
}
|