Merge branch 'master' of itcorp.primaya.id:rajif/aso

This commit is contained in:
Linksehat Dev
2022-11-03 09:52:53 +07:00
13 changed files with 161 additions and 110 deletions

View File

@@ -1,29 +0,0 @@
<?php
namespace Modules\Linksehat\Transformers\Dashboard;
use Illuminate\Http\Resources\Json\JsonResource;
use Str;
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 ?? '',
'address' => $this->currentAddress ?? '',
'distance' => $this->distance ? ($this->distance < 1 ? round($this->distance * 1000, 2) . " m" : round($this->distance, 2) . " km") : null,
'photos' => [
'title' => Str::slug($this->name),
'url' => asset('images/default-hospital-image.png'),
]
];
}
}