mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-10 21:01:05 +03:30
34 lines
938 B
PHP
34 lines
938 B
PHP
<?php
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class CycleResource extends JsonResource
|
|
{
|
|
/**
|
|
* Transform the resource into an array.
|
|
*
|
|
* @param Request $request
|
|
* @return array
|
|
*/
|
|
public function toArray($request)
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'unique_id' => $this->unique_id,
|
|
'date' => $this->date,
|
|
'sterilizer_id' => $this->sterilizer_id,
|
|
'cycle_number' => $this->cycle_number,
|
|
'note' => $this->note,
|
|
'verified' => $this->verified,
|
|
'user_id' => $this->user_id,
|
|
'user' => UserResource::make($this->whenLoaded('user')),
|
|
'labels' => LabelResource::collection($this->whenLoaded('labels')),
|
|
'created_at' => $this->created_at,
|
|
'updated_at' => $this->updated_at
|
|
];
|
|
}
|
|
}
|