createTemp(); } public function __destruct() { $this->destroyTemp(); } public function root(): string { return $this->tempPath; } public function publicUrl(): string { return ''; } public function get(): string { return file_get_contents($this->tempPath); } private function createTemp(): void { $this->tempPath = '/tmp/'.pathinfo($this->path, PATHINFO_FILENAME); if (Storage::exists($this->storagePath())) { $stream = Storage::readStream($this->storagePath()); $contents = stream_get_contents($stream); file_put_contents($this->tempPath, $contents); } } private function destroyTemp(): void { @unlink($this->tempPath); } }