@extends('layouts.app') @section('title', 'Appointment Management') @section('no-page-header') @section('content')
Total Appointments {{ $appointments->total() }}
PendingOn this page
{{ $appointments->where('status', 'pending')->count() }}
ConfirmedOn this page
{{ $appointments->where('status', 'confirmed')->count() }}
CompletedOn this page
{{ $appointments->where('status', 'completed')->count() }}
@forelse($appointments as $appointment) @empty @endforelse
No. Date Time Customer Appointment Persons Status Actions
{{ $appointments->firstItem() + $loop->index }} {{ $appointment->appointment_date->format('d-m-Y') }} {{ $appointment->formatted_time }}
{{ $appointment->client->name ?? 'N/A' }}
@if($appointment->contact)
{{ $appointment->contact }}
@endif
{{ $appointment->appointment_title }}
@if($appointment->notes)
{{ $appointment->notes }}
@endif
{{ $appointment->no_of_persons }} {{ ucfirst($appointment->status) }}
View @if(in_array($appointment->status, ['pending', 'confirmed'], true)) Edit @endif @if($appointment->status == 'pending')
@csrf
@endif @if($appointment->status == 'confirmed')
@csrf
@endif @if(in_array($appointment->status, ['pending', 'confirmed']))
@csrf
@endif
No appointments found.
@if($appointments->hasPages())
Showing {{ $appointments->firstItem() }} to {{ $appointments->lastItem() }} of {{ $appointments->total() }} appointments
{{ $appointments->links() }}
@endif
@endsection @php function getStatusBadgeClass($status) { return match($status) { 'pending' => 'bg-yellow-100 text-yellow-800', 'confirmed' => 'bg-blue-100 text-blue-800', 'completed' => 'bg-green-100 text-green-800', 'cancelled' => 'bg-red-100 text-red-800', default => 'bg-gray-100 text-gray-800' }; } @endphp