--- a/src/Illuminate/Filesystem/FilesystemAdapter.php +++ b/src/Illuminate/Filesystem/FilesystemAdapter.php @@ -475,7 +475,7 @@ } - $stream = fopen(is_string($file) ? $file : $file->getRealPath(), 'r'); + $stream = fopen(is_string($file) ? $file : ($file->getRealPath() ?: $file->getPathname()), 'r'); // Next, we will format the path of the file and store the file using a stream since // they provide better performance than alternatives. Once we write the file this // stream will get closed automatically by us so the developer doesn't have to.