mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-11 23:01:07 +03:30
fix label and cycle
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<?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
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user