{{-- resources/views/admin/dashboard/index.blade.php --}} {{-- Admin dashboard — stat cards + recent tables, all permission-aware --}} @extends('layouts.admin') @section('title', 'Dashboard') @section('page_title', 'Dashboard') @section('page_css') @endsection @section('content') {{-- Page header --}} {{-- Stat cards row — only shows cards user has permission to see --}}
@if($totalHotels !== null) @endif @if($totalFlights !== null) @endif @if($totalDestinations !== null) @endif @if($openTickets !== null) @endif @if($totalCategories !== null) @endif @if($totalCountries !== null) @endif @if($totalBrands !== null) @endif @if($totalUsers !== null) @endif
{{-- Recent Hotels table — only if user can view hotels --}} @if($recentHotels->isNotEmpty() || (auth()->user()->hasRole('admin') || auth()->user()->can('hotels.view'))) @if($recentHotels->isNotEmpty())

Recent Hotels

@if(auth()->user()->can('hotels.view') || auth()->user()->hasRole('admin')) View All @endif
@foreach($recentHotels as $hotel) {{ $loop->iteration }} {{ $hotel->name }} {{ $hotel->destination->name ?? '—' }} @if($hotel->discount_percent) {{ $hotel->discount_percent }}% OFF @else @endif @if($hotel->is_top) @else @endif @if(auth()->user()->can('hotels.edit') || auth()->user()->hasRole('admin')) @else @endif @endforeach
@endif @endif {{-- Recent Support Tickets --}} @if($recentTickets->isNotEmpty())

Recent Support Tickets

View All
@foreach($recentTickets as $ticket) {{ $loop->iteration }} {{ $ticket->name }} {{ ucfirst($ticket->type) }} {{ $ticket->created_at->format('d M Y') }} {{ ucfirst($ticket->status) }} @endforeach
@endif {{-- If no stats or tables visible, show welcome message --}} @if(!$recentHotels->count() && !$recentTickets->count() && !$totalHotels && !$totalFlights)

Welcome to SailingSkies Admin

You are logged in. Use the sidebar navigation to access the modules you have been granted access to.

@endif @endsection