diff --git a/src/Files/TemporaryFile.php b/src/Files/TemporaryFile.php index 5827b99c..fbd7ebd9 100644 --- a/src/Files/TemporaryFile.php +++ b/src/Files/TemporaryFile.php @@ -53,8 +53,10 @@ public function sync(): TemporaryFile public function copyFrom($filePath, string $disk = null): TemporaryFile { if ($filePath instanceof UploadedFile) { - $readStream = fopen($filePath->getRealPath(), 'rb'); - } elseif ($disk === null && realpath($filePath) !== false) { + $filePath = $filePath->getRealPath(); + } + + if ($disk === null && realpath($filePath) !== false) { $readStream = fopen($filePath, 'rb'); } else { $diskInstance = app('filesystem')->disk($disk);