You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
635 B
29 lines
635 B
4 weeks ago
|
<?php
|
||
|
|
||
|
namespace App\Http\Resources\Patient;
|
||
|
|
||
|
use Illuminate\Http\Request;
|
||
|
use Illuminate\Http\Resources\Json\JsonResource;
|
||
|
|
||
|
class PatientListsResource extends JsonResource
|
||
|
{
|
||
|
/**
|
||
|
* Transform the resource into an array.
|
||
|
*
|
||
|
* @return array<string, mixed>
|
||
|
*/
|
||
|
public function toArray(Request $request = null): array
|
||
|
{
|
||
|
$lists = [];
|
||
|
foreach ($this->resource as $v) {
|
||
|
$lists[] = [
|
||
|
'patient_id' => $v['patient_id'],
|
||
|
'patient_name' => $v['name'],
|
||
|
'is_default' => $v['def_status']
|
||
|
];
|
||
|
}
|
||
|
|
||
|
return $lists;
|
||
|
}
|
||
|
}
|