api get person/doctor by speciality
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Linksehat\Transformers\Speciality;
|
||||
|
||||
use App\Models\Practice;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class SpecialityResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
* Transform the resource into an array.
|
||||
*
|
||||
* @param \Illuminate\Http\Request
|
||||
* @return array
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
return [
|
||||
'doctors' => [
|
||||
'name' => $this->practitioner->person->name,
|
||||
'specialis' => 'Spesialis ' . $this->speciality->name,
|
||||
'experience' => rand(5, 12),
|
||||
'rating' => rand(20, 100),
|
||||
'price' => '',
|
||||
]
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user