$this->id, 'uuid' => $this->uuid, 'ticket_num' => $this->ticket_num, 'subject' => $this->subject, 'description' => $this->description, 'status' => $this->status, 'room' => $this->room, 'data' => $this->data ? (is_string($this->data) ? json_decode($this->data, true) : $this->data) : null, 'gallery' => $this->gallery ?? [], 'customer_id' => $this->customer_id, 'customer' => $this->whenLoaded('customer', fn() => [ 'id' => $this->customer->id, 'uuid' => $this->customer->uuid, 'fullname' => $this->customer->fullname, 'email' => $this->customer->email, ]), 'replies' => TicketReplyResource::collection($this->whenLoaded('reply')), 'created_at' => $this->created_at, 'updated_at' => $this->updated_at, ]; } }