headers->makeDisposition($disposition, $this->streamable->basename()); $response->headers->replace([ 'Accept-Ranges' => 'bytes', 'Content-Type' => $this->streamable->mimetype(), 'Content-Length' => $this->streamable->size(), 'Content-Disposition' => $disposition, ]); $fs = Storage::disk($this->disk()); $response->setCallback(function () use ($fs): void { $stream = $fs->readStream($this->streamable->path()); fpassthru($stream); fclose($stream); }); return $response; } }