Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Symfony2 Stream Response

Symfony2 Stream Response Laravel Package

irongit/symfony2-stream-response

A Symfony2 bundle that provides streamed HTTP responses, letting you push large or generated content to the client incrementally instead of buffering it all in memory. Useful for big file downloads, exports, and long-running output where streaming improves performance and reduces memory use.

View on GitHub
Deep Wiki
Context7

Response class to send file and other streams to client

Frequently asked questions about Symfony2 Stream Response
Can I use irongit/symfony2-stream-response in a Laravel application?
No, not through any supported Composer path. It is a Symfony 2.x bundle with bundle registration scaffolding, and Laravel does not have a bundle mechanism; it only consumes Symfony components such as symfony/http-foundation. You would have to vendor and rewrite the code, at which point it is no longer this package. Use Laravel's native streaming response methods instead.
How do I stream a large file download in Laravel without loading it into memory?
Use response()->streamDownload($callback, $filename) for a generated or streamed download with a filename, or response()->download($path) for an existing file. Both return a Symfony StreamedResponse or BinaryFileResponse and send content in chunks instead of buffering the whole payload. For static files with range support, response()->file($path) is the usual choice.
What is the difference between response()->stream() and response()->streamDownload() in Laravel?
response()->stream($callback) returns a StreamedResponse for arbitrary chunked output, such as generated reports or server-sent output. response()->streamDownload($callback, $name, $headers) wraps the same streaming behavior but adds download headers such as Content-Disposition with a filename. Use stream() for inline output and streamDownload() when the browser should save the response as a file.
Does irongit/symfony2-stream-response support byte-range requests for resumable downloads?
There is no evidence of byte-range handling in this 2013-era package, so resumable downloads and partial-content recovery are unlikely. Symfony's BinaryFileResponse, which backs Laravel's response()->file() and response()->download(), handles ranges natively. If range support matters, use the native Laravel methods or offload the transfer.
Is irongit/symfony2-stream-response still maintained and compatible with PHP 8?
No. Symfony 2 reached end of life in 2018, and this package predates that; there is no security response, no PHP 8 compatibility work, and no maintained release line. It has 1 star and 0 dependents, so there is no community backstop or downstream validation. Treat it as a reference implementation only.
How do I install irongit/symfony2-stream-response with Composer?
It was intended for Symfony 2 projects and is not installable into a Laravel app through a supported Composer path. Even in a Symfony 2 context, Composer 2 may not resolve it without a classmap entry because of its PSR-0-era layout. For Laravel, do not install it; use the framework's built-in streamed response API.
Which Laravel versions support streamed responses?
Laravel has provided response()->stream() and response()->streamDownload() since the 5.x era, built on Symfony's StreamedResponse. Modern Laravel releases continue to expose these helpers and also support Symfony's StreamedJsonResponse where the underlying Symfony version provides it. Check your Laravel and Symfony versions if you need StreamedJsonResponse specifically.
How do I test a streamed response in Laravel?
Laravel's TestResponse exposes streamedContent() so you can assert the body produced by a streamed callback. Call $response->streamedContent() after the request and assert against the returned string. This lets you test response()->stream() and streamDownload() without sending real chunks to a client.
What are alternatives to irongit/symfony2-stream-response for streaming responses in Laravel?
Use Laravel's native response()->stream(), response()->streamDownload(), response()->file(), and response()->download() first; they cover generated output, streamed downloads, and range-aware file serving. For very large or static assets, consider offloading with Nginx X-Accel-Redirect/X-Sendfile or pre-signed object-storage URLs so PHP does not stream bytes at all. This package is not a viable alternative for Laravel.
Can I use X-Accel-Redirect or X-Sendfile instead of PHP streaming for large downloads?
Yes, and it is often the better option behind Nginx or a CDN. X-Accel-Redirect lets PHP authorize the request and then hand the file transfer to Nginx, while pre-signed object-storage URLs remove PHP from the data path entirely. Use PHP-side streaming only when the content must be generated incrementally and cannot be offloaded.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle
adachsoft/api-version-bundle
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
cgv/localized-resource