mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-10 22:11:08 +03:30
31 lines
774 B
PHP
31 lines
774 B
PHP
<?php
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class UserResource extends JsonResource
|
|
{
|
|
/**
|
|
* Transform the resource into an array.
|
|
*
|
|
* @param Request $request
|
|
* @return array
|
|
*/
|
|
public function toArray($request)
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'name' => $this->name,
|
|
'email' => $this->email,
|
|
'status' => $this->status,
|
|
'address' => $this->address,
|
|
'gender' => $this->gender,
|
|
'medical_center' => MedicalCenterResource::make($this->whenLoaded('medical_center')),
|
|
'created_at' => $this->created_at,
|
|
'updated_at' => $this->updated_at
|
|
];
|
|
}
|
|
}
|