*/ public function toArray(Request $request): array { return [ 'id' => $this->id, 'note' => $this->note, 'priority' => $this->priority, 'image' => $this->image, 'code' => $this->code, 'modality' => $this->modality, 'status' => $this->status, 'priority' => $this->priority, 'pet' => $this->relationLoaded('pet') ? optional($this->pet)->only(['id','name','birthday']) : null, 'requester' => $this->relationLoaded('requester') ? optional($this->requester)->only(['id','fullname']) : null, 'submitted_at' => verta($this->submitted_at)->format('%Y/%m/%d - H:i'), 'processing_deadline' => verta($this->processing_deadline)->format('%Y/%m/%d - H:i'), ]; } }