add api linksehat/dashboard

This commit is contained in:
Muhammad Fajar
2022-10-25 18:13:02 +07:00
parent b0d74c222e
commit d0ce5772c2
6 changed files with 143 additions and 6 deletions

View File

@@ -0,0 +1,27 @@
<?php
namespace Modules\Linksehat\Transformers\Dashboard;
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)
{
return [
'id' => $this->practitioner->person->id,
'name' => $this->practitioner->person->name,
'specialis' => $this->speciality->name,
'photos' => [
'title' => 'doctors-avatar-' . $this->id,
'url' => asset('images/default-doctor-avatar.png')
]
];
}
}