*/ public function toArray(Request $request): array { return [ 'id' => $this->id, 'title' => $this->title, 'extension' => $this->extension, 'download_url' => Storage::url($this->pathname), 'size' => $this->size, 'created_by' => $this->createdBy?new UserProfileResource($this->createdBy):null, 'created_at' => (string)$this->created_at, 'version' => $this->version, ]; } }