94 lines
2.8 KiB
PHP
94 lines
2.8 KiB
PHP
<?php
|
|
$items = [];
|
|
if (in_array($roles::AGENT, $userRoles) || in_array($roles::COMPANY_ADMIN, $userRoles)) {
|
|
$items[] = [
|
|
'target' => 'route',
|
|
'route' => 'home',
|
|
'name' => 'Главная',
|
|
'icon' => 'columns-gap',
|
|
];
|
|
}
|
|
if (in_array($roles::AGENT, $userRoles) || in_array($roles::COMPANY_ADMIN, $userRoles)) {
|
|
$items[] = [
|
|
'target' => 'route',
|
|
'route' => 'clients.table',
|
|
'name' => 'Клиенты',
|
|
'icon' => 'person',
|
|
];
|
|
}
|
|
if (in_array($roles::AGENT, $userRoles) || in_array($roles::COMPANY_ADMIN, $userRoles)) {
|
|
$items[] = [
|
|
'target' => 'modal',
|
|
'modal' => '#plan7Modal',
|
|
'name' => 'Проекты',
|
|
'icon' => 'book',
|
|
];
|
|
}
|
|
|
|
$items[] = [
|
|
'target' => 'route',
|
|
'route' => 'posts',
|
|
'name' => 'Новости',
|
|
'icon' => 'layers',
|
|
];
|
|
|
|
if (in_array($roles::COMPANY_ADMIN, $userRoles)) {
|
|
$items[] = [
|
|
'target' => 'route',
|
|
'route' => 'company.agents.table',
|
|
'name' => 'Агенты',
|
|
'icon' => 'people',
|
|
];
|
|
}
|
|
|
|
$items[] = [
|
|
'target' => 'route',
|
|
'route' => 'docs.index',
|
|
'name' => 'Документы',
|
|
'icon' => 'archive',
|
|
];
|
|
|
|
if (in_array($roles::COMPANY_ADMIN, $userRoles)) {
|
|
$items[] = [
|
|
'target' => 'route',
|
|
'route' => 'company.details',
|
|
'name' => 'Настройки',
|
|
'icon' => 'gear',
|
|
];
|
|
}
|
|
|
|
if (in_array($roles::SUPER_ADMIN, $userRoles)) {
|
|
$items[] = [
|
|
'target' => 'route',
|
|
'route' => 'admin.index',
|
|
'name' => 'Админка',
|
|
'icon' => 'arrow-right-square',
|
|
];
|
|
}
|
|
?>
|
|
<div>
|
|
@php($current = Route::currentRouteName())
|
|
<ul class="nav flex flex-md-column ">
|
|
@foreach ($items as $item)
|
|
<li class="nav-item text-center m-2">
|
|
@if ($item['target'] == 'route')
|
|
<a href="{{ route($item['route']) }}"
|
|
class="nav-link d-flex align-items-center gap-2 fs-5 border rounded-4
|
|
@if (Route::currentRouteName() == $item['route']) active @endif"
|
|
aria-current="page">
|
|
<i class="bi bi-{{ $item['icon'] }}"></i> <span
|
|
class="d-none d-lg-inline text-truncate">{{ $item['name'] }}</span>
|
|
</a>
|
|
@endif
|
|
@if ($item['target'] == 'modal')
|
|
<a href="#" data-bs-toggle="modal" data-bs-target="{{ $item['modal'] }}"
|
|
class="nav-link d-flex align-items-center gap-2 fs-5 border rounded-4" aria-current="page">
|
|
<i class="bi bi-{{ $item['icon'] }}"></i> <span
|
|
class="d-none d-lg-inline text-truncate">{{ $item['name'] }}</span>
|
|
</a>
|
|
@endif
|
|
</li>
|
|
@endforeach
|
|
</ul>
|
|
</div>
|