@php $logoUrl = \App\Models\Setting::logoDarkUrl(); $appName = \App\Models\Setting::get('app_name', 'Admin Panel'); $role = session('admin_role'); @endphp @if($logoUrl) {{ $appName }} @else logo @endif @php $role = session('admin_role'); // Badge counts — computed once, used throughout sidebar $pendingFeedback = in_array($role, ['super_admin', 'sales']) ? \App\Models\Feedback::where('status', 'pending')->count() : 0; $pendingBookings = in_array($role, ['super_admin', 'sales']) ? \App\Models\Bookings::where('booking_status', 'pending')->count() : 0; $brokerBookings = 0; if ($role === 'broker') { $adminUser = \Illuminate\Support\Facades\Auth::guard('admin')->user(); $frontendUser = $adminUser ? \App\Models\User::where('email', $adminUser->email) ->where('role', 'broker') ->first() : null; $brokerBookings = $frontendUser ? \App\Models\Bookings::where('booked_by_broker_id', $frontendUser->id) ->where('booking_status', 'pending') ->count() : 0; } $pendingPayments = in_array($role, ['super_admin', 'sales']) ? \App\Models\PaymentTransaction::where('status', 'pending')->count() : 0; $newLeads = in_array($role, ['super_admin', 'sales']) ? \App\Models\Lead::where('status', 'new')->count() : 0; $wishlistCount = in_array($role, ['super_admin', 'sales']) ? \App\Models\WishlistModel::whereDate('created_at', '>=', now()->subDays(7))->count() : 0; $unreadMessages = \App\Models\AdminMessage::where('is_read', false) ->where('sender', 'user') ->count(); $unreadNotifCount = $role === 'super_admin' ? \App\Models\UserNotification::where('is_read', false)->count() : 0; @endphp
    {{-- ═══════════════════════════════════ GENERAL — all roles see Dashboard ═══════════════════════════════════ --}} @if($role === 'super_admin')
  • General
  • Dashboard
  • @endif @if($role === 'broker')
  • General
  • Dashboard
  • @endif {{-- Admins: super_admin only --}} @if($role === 'super_admin')
  • Admins
  • @endif {{-- ═══════════════════════════════════ PROPERTY MANAGEMENT super_admin only — brokers & sales must NOT create/edit property data ═══════════════════════════════════ --}} @if($role === 'super_admin')
  • Property Management
  • Projects
  • Location
  • Master Plan
  • Floors
  • Units
  • Amenities
  • Walkthrough
  • Brochure
  • @endif {{-- Sales: read-only unit listing only (no create/edit via sidebar) --}} @if($role === 'sales')
  • Property
  • Projects
  • Units
  • @endif {{-- ═══════════════════════════════════ VIRTUAL TOUR ═══════════════════════════════════ --}} @if($role === 'super_admin')
  • Virtual Tour
  • 360° Virtual Tours
  • @endif {{-- Preview tour: all roles --}} {{-- ═══════════════════════════════════ USERS — super_admin only ═══════════════════════════════════ --}} @if($role === 'super_admin')
  • Users
  • Users
  • Brokers
  • @endif {{-- ═══════════════════════════════════ BOOKINGS & PAYMENTS super_admin + sales: full bookings broker: only own bookings ═══════════════════════════════════ --}}
  • Bookings & Payments
  • @if(in_array($role, ['super_admin', 'sales']))
  • Feedback @if($pendingFeedback > 0) {{ $pendingFeedback }} @endif
  • Bookings @if($pendingBookings > 0) {{ $pendingBookings }} @endif
  • Payments @if($pendingPayments > 0) {{ $pendingPayments }} @endif
  • Instant Bookings
  • All Invoices
  • @endif @if($role === 'broker')
  • My Bookings @if($brokerBookings > 0) {{ $brokerBookings }} @endif
  • My Payments
  • @endif @if($role === 'super_admin')
  • Payment Plans
  • @endif {{-- ═══════════════════════════════════ LEADS — super_admin + sales only ═══════════════════════════════════ --}} @if(in_array($role, ['super_admin', 'sales']))
  • Leads
  • @if(in_array($role, ['super_admin']))
  • All Leads @if($newLeads > 0) {{ $newLeads }} @endif
  • @endif @if($role === 'sales')
  • My Leads
  • @endif @endif {{-- ═══════════════════════════════════ CRM — super_admin + sales only ═══════════════════════════════════ --}} @if(in_array($role, ['super_admin', 'sales']))
  • CRM
  • Wishlists @if($wishlistCount > 0) {{ $wishlistCount }} @endif
  • Messages @if($unreadMessages > 0) {{ $unreadMessages > 99 ? '99+' : $unreadMessages }} @endif
  • @endif {{-- ═══════════════════════════════════ REPORTS ═══════════════════════════════════ --}} @if($role === 'super_admin')
  • Reports & Analytics
  • Overview
  • Revenue Report
  • Booking Report
  • Sales Report
  • Tour Analytics
  • @endif @if(in_array($role, ['sales', 'broker']))
  • My Reports
  • My Performance
  • @endif {{-- ═══════════════════════════════════ SETTINGS — super_admin only ═══════════════════════════════════ --}} @if($role === 'super_admin')
  • Settings
  • SMTP
  • Payment Gateway
  • @endif @if(in_array($role, ['super_admin', 'sales']))
  • Notifications @if($unreadNotifCount > 0) {{ $unreadNotifCount > 99 ? '99+' : $unreadNotifCount }} @endif
  • @endif @if($role === 'super_admin')
  • SMS Settings @if(!\App\Models\SmsSetting::active()) ! @endif
  • Invoice Settings
  • @endif {{-- ═══════════════════════════════════ ACCOUNT — all roles ═══════════════════════════════════ --}}
  • Account
  • My Profile
  • Logout
    @csrf