fix dashboardcontroller query & resources doctors
This commit is contained in:
@@ -28,9 +28,11 @@ class DashboardController extends Controller
|
||||
])
|
||||
->where('active', 1)
|
||||
->whereNot('speciality_id')
|
||||
->get(['id', 'speciality_id'])
|
||||
->get(['id', 'practitioner_id', 'speciality_id'])
|
||||
->random($limit);
|
||||
|
||||
return $queryDoctors;
|
||||
|
||||
$data = DoctorResourceDashboard::collection($queryDoctors);
|
||||
} elseif ($query === 'hospitals') {
|
||||
$queryHospitals = Organization::query()
|
||||
|
||||
@@ -15,11 +15,11 @@ class DoctorResource extends JsonResource
|
||||
public function toArray($request)
|
||||
{
|
||||
return [
|
||||
'id' => $this->practitioner->person->id,
|
||||
'name' => $this->practitioner->person->name,
|
||||
'specialis' => "Spesialis " . $this->speciality->name,
|
||||
'id' => $this->practitioner_id,
|
||||
'name' => $this->person->name ?? '',
|
||||
'specialis' => "Spesialis " . $this->speciality->name ?? '',
|
||||
'photos' => [
|
||||
'title' => 'doctors-avatar-' . $this->id,
|
||||
'title' => 'doctors-avatar-' . $this->practitioner_id,
|
||||
'url' => asset('images/default-doctor-avatar.png')
|
||||
]
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user