@php $u = auth()->user(); $initials = strtoupper(mb_substr($u->name, 0, 2)); $twoFactorEnabled = $u->hasTwoFactorEnabled(); // Profile, security and sessions are self-service (visible to everyone). The // login-protection + email tabs need manage-panel; the users tab needs // manage-users — the tab bodies re-guard, so hiding the nav entry is just UX. $tabs = [ ['key' => 'profile', 'label' => __('settings.tab_profile'), 'icon' => 'settings'], ['key' => 'security', 'label' => __('settings.tab_security'), 'icon' => 'shield'], ]; if (auth()->user()?->can('manage-panel')) { $tabs[] = ['key' => 'login-protection', 'label' => __('settings.tab_login_protection'), 'icon' => 'shield']; } if (auth()->user()?->can('manage-users')) { $tabs[] = ['key' => 'users', 'label' => __('settings.tab_users'), 'icon' => 'user-plus']; } $tabs[] = ['key' => 'sessions', 'label' => __('settings.tab_sessions'), 'icon' => 'logout']; if (auth()->user()?->can('manage-panel')) { $tabs[] = ['key' => 'email', 'label' => __('settings.tab_email'), 'icon' => 'mail']; } @endphp
@if ($openRecoveryModal)
@endif {{-- Identity header --}}
{{ $initials }}

{{ __('settings.account') }}

{{ $u->name }}

{{ $u->email }}

{{ $u->role?->label() ?? __('settings.role_admin') }}
{{-- Section nav --}} {{-- Content --}}
@if ($tab === 'profile') @elseif ($tab === 'security') @elseif ($tab === 'login-protection') @elseif ($tab === 'users') @elseif ($tab === 'sessions') @elseif ($tab === 'email') {{-- Unknown ?tab= falls back to profile instead of rendering nothing. --}} @else @endif