39 lines
1.2 KiB
PHP
39 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace Modules\Internal\Transformers;
|
|
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class DoctorResource extends JsonResource
|
|
{
|
|
/**
|
|
* Transform the resource into an array.
|
|
*
|
|
* @param \Illuminate\Http\Request
|
|
* @return array
|
|
*/
|
|
public function toArray($request)
|
|
{
|
|
$doctor = [
|
|
'id' => $this->id,
|
|
'his_dokter_id' => $this->meta->DokterID,
|
|
'name' => $this->practitioner->person->name,
|
|
'phone' => $this->practitioner->person->phone,
|
|
'email' => $this->practitioner->person->email,
|
|
'address' => $this->practitioner->person->currentAddress->text,
|
|
'organization' => $this->organization->name,
|
|
'organization_id' => $this->organization->id,
|
|
'specialty' => $this->speciality->name,
|
|
'specialtyI_id' => $this->speciality->id,
|
|
'education' => $this->practitioner->meta->education,
|
|
'experience' => $this->practitioner->meta->work_experience,
|
|
'award' => $this->practitioner->meta->award,
|
|
'keilmuan' => $this->practitioner->meta->Keilmuan,
|
|
'tipe_dokter' => $this->practitioner->meta->tipeDokter,
|
|
|
|
];
|
|
|
|
return $doctor;
|
|
}
|
|
}
|