Files
2023-01-17 12:21:26 +01:00

30 lines
776 B
PHP

<?php
namespace App\Http\Resources;
use Illuminate\Http\Resources\Json\JsonResource;
class UserResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request $request
* @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable
*/
public function toArray($request)
{
return [
'id' => $this->id,
'name' => $this->firstname,
'surname' => $this->lastname,
'email' => $this->email,
'code' => $this->code,
'work_start' => $this->work_start,
'work_end' => $this->work_end,
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
];
}
}