check()) { abort(404); } /** @var \Illuminate\Filesystem\FilesystemAdapter */ $disk = Storage::disk('uploads'); if (!$disk->exists($filePath)) { abort(404); } return response()->stream(function () use ($disk, $filePath) { $stream = $disk->readStream($filePath); \fpassthru($stream); \fclose($stream); }, 200, [ 'Content-Type' => File::mimeType($disk->path($filePath)), 'Content-Length' => $disk->size($filePath), 'Content-Disposition' => 'inline', ]); } }