Commit 1bd792e9 authored by Nicolas Widart's avatar Nicolas Widart

Fixing the request check

parent 20437264
<?php namespace Modules\User\Composers; <?php namespace Modules\User\Composers;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Request;
class SidebarViewComposer class SidebarViewComposer
{ {
...@@ -9,19 +10,19 @@ class SidebarViewComposer ...@@ -9,19 +10,19 @@ class SidebarViewComposer
$view->items->put('user', Collection::make([ $view->items->put('user', Collection::make([
[ [
'weight' => '1', 'weight' => '1',
'request' => "{$view->prefix}/users*", 'request' => Request::is("{$view->prefix}/users*") or Request::is("{$view->prefix}/roles*"),
'route' => '#', 'route' => '#',
'icon-class' => 'fa fa-user', 'icon-class' => 'fa fa-user',
'title' => 'Users & Roles', 'title' => 'Users & Roles',
], ],
[ [
'request' => "{$view->prefix}/users", 'request' => "{$view->prefix}/users*",
'route' => 'dashboard.user.index', 'route' => 'dashboard.user.index',
'icon-class' => 'fa fa-user', 'icon-class' => 'fa fa-user',
'title' => 'Users', 'title' => 'Users',
], ],
[ [
'request' => "{$view->prefix}/roles", 'request' => "{$view->prefix}/roles*",
'route' => 'dashboard.role.index', 'route' => 'dashboard.role.index',
'icon-class' => 'fa fa-flag-o', 'icon-class' => 'fa fa-flag-o',
'title' => 'Roles', 'title' => 'Roles',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment