client = $client->loadCount([ 'consultations', 'consultations as pending_consultations_count' => fn ($q) => $q->where('status', ConsultationStatus::Pending), 'consultations as completed_consultations_count' => fn ($q) => $q->where('status', ConsultationStatus::Completed), 'timelines', 'timelines as active_timelines_count' => fn ($q) => $q->where('status', TimelineStatus::Active), ]); } }; ?>