Merge remote-tracking branch 'origin/master' into mhmfajar
This commit is contained in:
0
Modules/Linksehat/Transformers/Article/ArticleResource.php
Normal file → Executable file
0
Modules/Linksehat/Transformers/Article/ArticleResource.php
Normal file → Executable file
0
Modules/Linksehat/Transformers/Doctor/DoctorResource.php
Normal file → Executable file
0
Modules/Linksehat/Transformers/Doctor/DoctorResource.php
Normal file → Executable file
0
Modules/Linksehat/Transformers/Doctor/DoctorResourceDetail.php
Normal file → Executable file
0
Modules/Linksehat/Transformers/Doctor/DoctorResourceDetail.php
Normal file → Executable file
0
Modules/Linksehat/Transformers/DoctorResource.php
Normal file → Executable file
0
Modules/Linksehat/Transformers/DoctorResource.php
Normal file → Executable file
0
Modules/Linksehat/Transformers/Hospital/HospitalResource.php
Normal file → Executable file
0
Modules/Linksehat/Transformers/Hospital/HospitalResource.php
Normal file → Executable file
0
Modules/Linksehat/Transformers/Hospital/HospitalResourceDetail.php
Normal file → Executable file
0
Modules/Linksehat/Transformers/Hospital/HospitalResourceDetail.php
Normal file → Executable file
38
Modules/Linksehat/Transformers/HospitalResource.php
Executable file
38
Modules/Linksehat/Transformers/HospitalResource.php
Executable file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Linksehat\Transformers;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class HospitalResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
* Transform the resource into an array.
|
||||
*
|
||||
* @param \Illuminate\Http\Request
|
||||
* @return array
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'name' => $this->name,
|
||||
'code' => $this->code,
|
||||
'description' => $this->description,
|
||||
'address' => $this->currentAddress->text ?? null,
|
||||
'lat' => $this->currentAddress->lat ?? null,
|
||||
'lng' => $this->currentAddress->lng ?? null,
|
||||
'distance' => isset($this->distance_km) ? round($this->distance_km) . ' km' : null,
|
||||
'city_name' => $this->currentAddress->city->name ?? null,
|
||||
'rating' => rand(350, 500) / 100,
|
||||
'phone' => $this->meta->phone,
|
||||
'photo_url' => asset('images/default-hospital-image.png'),
|
||||
'photos' => [
|
||||
[
|
||||
'title' => $this->name,
|
||||
'photo_url' => asset('images/default-hospital-image.png'),
|
||||
]
|
||||
]
|
||||
];
|
||||
}
|
||||
}
|
||||
0
Modules/Linksehat/Transformers/Person/PersonResource.php
Normal file → Executable file
0
Modules/Linksehat/Transformers/Person/PersonResource.php
Normal file → Executable file
0
Modules/Linksehat/Transformers/PractitionerRoleToDoctorDetailResource.php
Normal file → Executable file
0
Modules/Linksehat/Transformers/PractitionerRoleToDoctorDetailResource.php
Normal file → Executable file
0
Modules/Linksehat/Transformers/PractitionerRoleToDoctorResource.php
Normal file → Executable file
0
Modules/Linksehat/Transformers/PractitionerRoleToDoctorResource.php
Normal file → Executable file
0
Modules/Linksehat/Transformers/Speciality/SpecialityResource.php
Normal file → Executable file
0
Modules/Linksehat/Transformers/Speciality/SpecialityResource.php
Normal file → Executable file
0
Modules/Linksehat/Transformers/UserProfileResource.php
Normal file → Executable file
0
Modules/Linksehat/Transformers/UserProfileResource.php
Normal file → Executable file
Reference in New Issue
Block a user