@php // Detect if current page is a user/public page (not admin panel) $isUserPage = request()->routeIs('user.*') || request()->routeIs('welcome') || request()->routeIs('favorites.*') || request()->routeIs('laundry.index') && !auth()->check(); @endphp
@if(!$isUserPage)
@endif
SPK Kontrakan & Laundry
@if($isUserPage)
Beranda
@auth @if(auth()->user()->role === 'user') {{-- USER BIASA --}}
Booking
@php $bookingCount = \App\Models\Booking::where('user_id', auth()->id())->whereIn('status', ['pending', 'confirmed'])->count(); @endphp @if($bookingCount > 0)
{{ $bookingCount }}
@endif
Favorit
@php $favCount = \App\Models\Favorite::where('user_id', auth()->id())->count(); @endphp @if($favCount > 0)
{{ $favCount }}
@endif
{{ auth()->user()->name }}
Riwayat Booking
Favorit Saya
@csrf
Logout
@else {{-- ADMIN/SUPER ADMIN --}}
Dashboard Admin
@endif @else {{-- GUEST (Belum Login) - Hanya untuk User Biasa --}}
Login
@endauth @else {{-- Admin pages - no extra buttons needed --}} @endif @if(!$isUserPage) @auth
{{ strtoupper(substr(Auth::user()->name, 0, 1)) }}
{{ Auth::user()->name }}
Administrator
Dashboard
@if(auth()->user()->isSuperAdmin())
Kelola User
Activity Log
Backup & Restore
@endif
@csrf
Logout
@endauth @endif
@auth @if(!$isUserPage)
Menu Utama
Dashboard
Manajemen Data
Data Kontrakan
Data Laundry
Booking Kontrakan
Data Kriteria
Sistem Analisis
Sistem Rekomendasi
@endif @endauth
@yield('content')
@include('components.toast-notification') @yield('scripts')