{{-- resources/views/agent/appointments/index.blade.php --}} @extends('layouts.contentLayoutMaster') @section('title','My Appointments') @section('content') @php use Illuminate\Support\Facades\Route as R; @endphp
{{-- Added mt-4 for more top margin --}} {{-- Header with optional "for {Client Name}" --}}

My Appointments @isset($activeClient) @php $activeName = $activeClient->name ?? trim(($activeClient->first_name ?? '').' '.($activeClient->last_name ?? '')); @endphp for {{ $activeName }} @endisset

{{-- Status Update Dropdown and Save (unchanged) --}}
@csrf
@isset($activeClient) Clear Filter @endisset Schedule Appointment
{{-- Narrowed Actions column --}} @forelse($appointments as $a) @empty @endforelse
When Title Client Status LocationActions
{{ optional($a->starts_at)->format('M d, Y g:i A') }} {{ $a->title }} @php $client = $a->client; $clientName = $client?->name; if (!$clientName) { $first = $client?->first_name ?? ''; $last = $client?->last_name ?? ''; $clientName = trim("$first $last"); } @endphp {{ $clientName !== '' ? $clientName : '—' }} @php $statusColors = [ 'confirmed' => 'success', 'pending' => 'warning', 'cancelled' => 'danger', 'no show' => 'dark', 'completed' => 'primary' ]; $badgeColor = $statusColors[$a->status] ?? 'secondary'; @endphp {{ ucfirst($a->status) }} {{ $a->location ?: '—' }}
@if (R::has('agent.appointments.show')) View @endif @if (R::has('agent.appointments.edit')) Edit @endif @php $joinUrl = $a->meeting_url ?? null; @endphp @if ($joinUrl) Join @endif {{-- Removed the "Client" button per request --}} {{-- Per-row Delete button using bulkDelete route --}}
@csrf
@isset($activeClient) No appointment has been scheduled for this client, yet. @else No appointments yet. @endisset
{{ $appointments->appends(request()->only('client_id'))->links() }}
@endsection @section('scripts') @endsection