userInfo){ $this->owner->userInfo = $this->userInfo; } return [ 'id' => $this->id, 'reference' => $this->reference, 'status' => (int) $this->status, 'document_type' => $this->document_type, 'owner' => $this->relationLoaded('owner') ? ($this->owner instanceof Booking ? new BookingV2Resource($this->owner) : new CompanyV2Resource($this->owner)) : null, 'files' => FileV2Resource::collection($this->files), 'created_at' => Carbon::parse($this->created_at)->format('d-m-Y h:i:s A') ]; } }