@if (!$isLoaded)
Loading...

Loading doctors...

@else

Doctor Management Total Doctors: {{ $doctors->total() ?? 0 }}

@forelse ($doctors as $user) @php $association = $user->clinicAssociations->first(); $profile = $user?->doctorProfile; $profileImage = $user->doctor?->profile_image; @endphp @empty @endforelse
Name {!! $sortField === 'name' ? ($sortDirection === 'asc' ? '↑' : '↓') : '' !!} Email License Number Primary Clinic Status {!! $sortField === 'status' ? ($sortDirection === 'asc' ? '↑' : '↓') : '' !!} Approval Status
{{ $user->email }} {{ $profile->license_number ?? 'N/A' }} @php $primaryClinic = $user->clinics->where('pivot.is_primary', true)->first(); @endphp @if ($primaryClinic) @if ($primaryClinic->name === $clinic->name) {{ $primaryClinic->name }} @else {{ $primaryClinic->name }} @endif @else N/A @endif {{ ucfirst($association?->status ?? 'Inactive') }}
{{ ucfirst($association?->approval_status ?? 'Pending') }}
No doctors found.
{{-- Pagination --}} @endif