@auth @php $u = auth()->user(); $isSuper = $u->isSuperAdmin(); // Build nav items conditionally so we never link to a missing route. $has = fn ($r) => \Route::has($r); if ($isSuper) { $items = [ ['label' => _lang('Home'), 'icon' => 'bi-speedometer2', 'route' => 'admin.dashboard', 'active' => 'admin.dashboard'], ['label' => _lang('Organizations'), 'icon' => 'bi-building', 'route' => 'admin.organizations.index', 'active' => 'admin.organizations.*'], ]; $fab = $has('admin.organizations.create') ? ['icon' => 'bi-plus-lg', 'route' => 'admin.organizations.create', 'label' => _lang('Add')] : null; } else { $items = [ ['label' => _lang('Home'), 'icon' => 'bi-house-door', 'route' => 'dashboard', 'active' => 'dashboard'], ]; if ($has('customers.index') && (function_exists('organization_module_enabled') ? organization_module_enabled('crm_module') : true)) { $items[] = ['label' => _lang('Customers'), 'icon' => 'bi-people', 'route' => 'customers.index', 'active' => 'customers.*']; } if ($has('staff.index') && ($u->isOrganizationOwner() || user_can('staff.manage'))) { $items[] = ['label' => _lang('Staff'), 'icon' => 'bi-person-badge', 'route' => 'staff.index', 'active' => 'staff.*']; } $fab = $has('customers.create') ? ['icon' => 'bi-plus-lg', 'route' => 'customers.create', 'label' => _lang('Add')] : null; } $items = array_slice($items, 0, 4); @endphp {{-- Backdrop for the mobile left menu --}}
@endauth