2018-04-18 00:38:11 -04:00
|
|
|
<nav class="navbar navbar-expand-lg">
|
2018-04-18 00:47:14 -04:00
|
|
|
@set('current_page', preg_replace([ '/^.*\//', '/\/.*/' ], [ '', '' ], Request::url()))
|
2016-01-26 23:20:08 -05:00
|
|
|
|
2018-04-16 12:24:28 -04:00
|
|
|
<a class="navbar-brand" href="{{ url('/dashboard') }}">
|
|
|
|
{{ env('APP_NAME') }} Dashboard
|
|
|
|
</a>
|
2016-01-26 23:20:08 -05:00
|
|
|
|
2018-04-16 12:24:28 -04:00
|
|
|
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#dashboard-navbar" aria-controls="dashboard-navbar" aria-expanded="false" aria-label="Toggle navigation">
|
2018-04-18 00:38:11 -04:00
|
|
|
<span class="navbar-toggler-icon">
|
|
|
|
<span class="navbar-toggler-icon-bar"></span>
|
|
|
|
<span class="navbar-toggler-icon-bar"></span>
|
|
|
|
<span class="navbar-toggler-icon-bar"></span>
|
|
|
|
</span>
|
2018-04-16 12:24:28 -04:00
|
|
|
</button>
|
2016-12-19 21:21:14 -05:00
|
|
|
|
2018-04-16 12:24:28 -04:00
|
|
|
<div id="dashboard-navbar" class="collapse navbar-collapse">
|
|
|
|
<ul class="navbar-nav ml-auto">
|
|
|
|
@if (Auth::guest())
|
|
|
|
<li class="nav-item"><a class="nav-link" href="{{ url('/login') }}">Login</a></li>
|
2018-01-12 22:57:31 -05:00
|
|
|
|
2018-04-16 12:24:28 -04:00
|
|
|
@if(env('REGISTRATION', false))
|
|
|
|
<li class="nav-item"><a class="nav-link" href="{{ url('/register') }}">Register</a></li>
|
|
|
|
@endif
|
|
|
|
@else
|
2018-04-18 00:38:11 -04:00
|
|
|
@foreach(App\Models\Dashboard::$menu as $menu_item)
|
2018-04-17 18:52:44 -04:00
|
|
|
@if(array_key_exists('submenu', $menu_item))
|
2018-04-18 00:38:11 -04:00
|
|
|
@set('dropdown_id', preg_replace([ '/\ \ */', '/[^a-z\-]/' ], [ '-', '' ], strtolower($menu_item['title'])))
|
|
|
|
|
2018-04-16 12:24:28 -04:00
|
|
|
<li class="nav-item dropdown">
|
2018-04-18 00:38:11 -04:00
|
|
|
<span id="menu-dropdown-{{ $dropdown_id }}" class="nav-link dropdown-toggle" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
2018-04-17 18:52:44 -04:00
|
|
|
{{ $menu_item['title'] }} <span class="caret"></span>
|
2018-04-18 00:38:11 -04:00
|
|
|
</span>
|
2016-12-19 21:21:14 -05:00
|
|
|
|
2018-04-18 00:38:11 -04:00
|
|
|
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="menu-dropdown-{{ $dropdown_id }}">
|
2018-04-17 18:52:44 -04:00
|
|
|
@foreach($menu_item['submenu'] as $submenu_item)
|
2018-04-18 00:47:14 -04:00
|
|
|
<a class="dropdown-item {{ $current_page == $submenu_item['model'] ? 'active' : '' }}" href="{{ url('/dashboard/' . $submenu_item['type'] . '/' . $submenu_item['model']) }}">{{ $submenu_item['title'] }}</a>
|
2018-04-16 12:24:28 -04:00
|
|
|
@endforeach
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
@else
|
|
|
|
<li class="nav-item">
|
2018-04-17 18:52:44 -04:00
|
|
|
<a class="nav-link {{ $current_page == $menu_item['model'] ? 'active' : '' }}" href="{{ url('/dashboard/' . $menu_item['type'] . '/' . $menu_item['model']) }}">
|
|
|
|
{{ $menu_item['title'] }}
|
2018-04-16 12:24:28 -04:00
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
@endif
|
|
|
|
@endforeach
|
2016-01-26 23:20:08 -05:00
|
|
|
|
2018-04-16 12:24:28 -04:00
|
|
|
<li class="nav-item dropdown">
|
|
|
|
<a id="user-dropdown" class="nav-link dropdown-toggle" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
|
|
{{ Auth::user()->name }} <span class="caret"></span>
|
|
|
|
</a>
|
|
|
|
|
|
|
|
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="user-dropdown">
|
|
|
|
<a class="dropdown-item" href="{{ url('/logout') }}">Logout</a>
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
@endif
|
|
|
|
</ul>
|
2016-01-26 23:20:08 -05:00
|
|
|
</div>
|
|
|
|
</nav>
|