Doctor List
Total Doctors: {{ $totalDoctors }}
|
Doctor
|
Specialization |
License Number |
Primary Clinic |
Status |
|
@forelse ($users as $user)
{{-- Doctor Column with Avatar --}}
|
|
{{-- Specialization --}}
@php
$spec = $user->doctor?->specialization ?? null;
$arr = [];
if (is_array($spec)) {
$arr = $spec;
} elseif (is_string($spec)) {
// कोशिश करो JSON decode करने की
$decoded = json_decode($spec, true);
if (json_last_error() === JSON_ERROR_NONE && is_array($decoded)) {
$arr = $decoded;
} else {
// नहीं तो comma-separated मान कर split करो
$arr = array_filter(array_map('trim', explode(',', $spec)));
}
}
@endphp
{{ count($arr) ? implode(',', $arr) : 'N/A' }}
|
{{-- License Number --}}
{{ $user->doctor?->license_number ?? 'N/A' }}
|
{{-- Primary Clinic --}}
@php
$primaryClinic = $user->clinics->where('pivot.is_primary', true)->first();
@endphp
{{ $primaryClinic ? $primaryClinic->name : 'N/A' }}
|
{{-- Status Badge --}}
@if ($user->status === 'active')
Active
@else
Inactive
@endif
|
{{-- Actions --}}
|
@empty
| No doctors found. |
@endforelse
Delete Confirmation
Are you sure you want to delete ?
@push('scripts')
@endpush