Update Doctor Resource
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace Modules\Linksehat\Transformers;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
class DoctorResource extends JsonResource
|
||||
{
|
||||
@@ -21,7 +22,12 @@ class DoctorResource extends JsonResource
|
||||
'hospital_id' => $practitionerRole->organization_id,
|
||||
'speciality_id' => $practitionerRole->speciality_id,
|
||||
'hospital' => HospitalResource::make($practitionerRole->organization),
|
||||
'speciality' => SpecialityResource::make($practitionerRole->speciality)
|
||||
'speciality' => SpecialityResource::make($practitionerRole->speciality),
|
||||
|
||||
'is_chat_available' => $practitionerRole->is_chat_available,
|
||||
'is_video_available' => $practitionerRole->is_video_available,
|
||||
'is_walkin_available' => $practitionerRole->is_walkin_available,
|
||||
'is_instant_chat_available' => $practitionerRole->is_instant_chat_available,
|
||||
];
|
||||
});
|
||||
|
||||
@@ -32,12 +38,12 @@ class DoctorResource extends JsonResource
|
||||
'name' => $this->person->name ?? null,
|
||||
'name_suffix' => $this->person->name_suffix ?? null,
|
||||
'gender' => $this->person->gender ?? null,
|
||||
// 'speciality_name' => !empty($this->speciality->name ?? null) ? 'Spesialis '. $this->speciality->name : 'Spesialis Empty',
|
||||
'is_online' => false,
|
||||
'is_insurance_covered' => rand(0,1) == 1,
|
||||
// 'price_range' => 'Rp 100.000 - Rp 350.000',
|
||||
// 'price_start' => '100000',
|
||||
// 'price_end' => '350000',
|
||||
'price_range' => 'Rp 100.000 - Rp 350.000',
|
||||
'price_start' => '100000',
|
||||
'price_end' => '350000',
|
||||
'currency' => 'IDR',
|
||||
'avatar_url' => asset('images/default-doctor-avatar.png'),
|
||||
'education' => $this->meta->education ?? '',
|
||||
'medical_treatment' => $this->meta->medical_treatment ?? '',
|
||||
@@ -45,7 +51,8 @@ class DoctorResource extends JsonResource
|
||||
'work_experience' => $this->meta->work_experience ?? '',
|
||||
'keilmuan' => $this->meta->keilmuan ?? '',
|
||||
'description' => $this->meta->description ?? '',
|
||||
'practices' => $practices
|
||||
'practices' => $practices,
|
||||
'rating' => rand(350, 500) / 10,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user