@extends('layouts.app') @section('title', 'My Bookings — CareerPath') @push('styles') @endpush @section('content') {{-- TOAST NOTIFICATION --}}
Done
{{-- PAGE HERO --}}
Dashboard My Bookings

📅 My Bookings

All your counseling sessions in one place

Book New Session
{{-- STATS ROW — uses all bookings for accurate counts --}} @php $allStats = \App\Models\Booking::where('user_id', auth()->id())->get(); $total = $allStats->count(); $pending = $allStats->where('status','pending')->count(); $confirmed = $allStats->where('status','confirmed')->count(); $completed = $allStats->where('status','completed')->count(); @endphp
📋
{{ $total }}
Total Sessions
{{ $pending }}
Pending
{{ $confirmed }}
Confirmed
🎓
{{ $completed }}
Completed
{{-- FILTER BAR --}}
All @foreach(['pending' => '⏳ Pending', 'confirmed' => '✅ Confirmed', 'completed' => '🎓 Completed', 'cancelled' => '❌ Cancelled'] as $val => $label) {{ $label }} @endforeach
{{-- BOOKING LIST --}}
@forelse($bookings as $b)
{{-- AVATAR --}}
{{ substr($b->counselor->user->name ?? 'C', 0, 1) }}
{{-- INFO --}}
{{ $b->counselor->user->name ?? 'Counselor' }}
{{ $b->counselor->specialization ?? 'Career Counselor' }}
{{ optional($b->booking_date)->format('d M Y') ?? '—' }} {{ $b->booking_time ?? '—' }} {{ ucfirst($b->meeting_type ?? 'Online') }} PKR {{ number_format($b->fee ?? 0) }}
{{-- SIDE: badge + action --}}
@if($b->status=='confirmed') ✅ @elseif($b->status=='pending') ⏳ @elseif($b->status=='completed') 🎓 @else ❌ @endif {{ ucfirst($b->status) }} @if($b->status == 'pending') @endif @if($b->status == 'confirmed') View @endif
{{-- MESSAGE --}} @if($b->student_message)
Your Message
{{ $b->student_message }}
@endif
@empty
📭

No bookings found

@if(request('status')) No {{ request('status') }} bookings. Try a different filter. @else You haven't booked any sessions yet. @endif

@if(request('status')) View All @endif Find a Counselor
@endforelse
{{-- PAGINATION --}} @if($bookings->hasPages())
{{ $bookings->appends(request()->query())->links() }}
@endif
@push('scripts') @endpush @endsection