{{-- Load CSS & Library --}} @vite('resources/css/app.css') @vite('resources/js/app.js') @php use Illuminate\Support\Facades\Auth; use Illuminate\Support\Str; use Illuminate\Notifications\DatabaseNotification; $path = request()->path(); $menuGroups = [ 'dashboard' => 'Beranda', 'tambah-audit' => 'Manajemen Audit', 'verifikasi-audit' => 'Manajemen Audit', 'riwayat-audit' => 'Manajemen Audit', 'hasil-audit' => 'Audit Divisi', 'hasil-verifikasi' => 'Audit Divisi', 'notifikasi' => 'Notifikasi', 'profile' => 'Pengaturan Akun', ]; $activeGroup = collect($menuGroups)->first( fn ($label, $key) => Str::contains($path, $key) ) ?? 'Beranda'; $notifCount = Auth::check() ? DatabaseNotification::where('notifiable_id', Auth::id())->whereNull('read_at')->count() : 0; @endphp
{{-- Sidebar --}} {{-- Konten Utama --}}
{{-- Header --}}
{{-- Left --}}

{{ $activeGroup }}

{{-- Right --}}
{{-- Profile Header --}} {{-- Notification --}} @if($notifCount > 0) {{ $notifCount > 99 ? '99+' : $notifCount }} @endif {{-- Dropdown --}}
{{-- Dropdown Menu --}}
{{-- Profile Card --}}
@if (Auth::user()->foto)
Foto Profil
@else
{{ strtoupper(substr(Auth::user()->name, 0, 1)) }}
@endif

{{ Auth::user()->name }}

{{ Auth::user()->email }}

{{-- Ganti Password --}} Ganti Password {{-- Logout Header --}}
@csrf
{{-- Konten Halaman --}}
@yield('content')
{{-- Footer --}}
@yield('scripts') @stack('scripts')