香洲二院小程序
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.
mini_xzey/app/Http/Resources/Patient/PatientListsResource.php

29 lines
635 B

<?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;
}
}