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

Resource Stream Laravel Package

phpro/resource-stream

phpro/resource-stream is a lightweight PHP library for wrapping resource handles in a consistent stream API. It simplifies reading, writing, seeking, and inspecting file, socket, or in-memory resources, making resource-based I/O easier to abstract and test.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Large-file export/download features: This package is a low-level primitive for streaming resources (files, streams, strings) into PSR-7/HTTP responses. It directly enables "export 500k rows to CSV" or "download 8GB archive" features without blowing PHP's memory limit or timing out under typical memory_limit settings.
  • Build vs. buy on streaming plumbing: The 1.4.0 addition of a ZipStream factory for reading zip entries is the deciding data point. If your roadmap includes ingesting user-uploaded ZIPs (bulk imports, media bundles, partner data drops), you can now process archives entry-by-entry as streams instead of extracting to disk or loading entries into memory. That's a build-vs-buy call you would otherwise solve with custom code around ZipArchive.
  • Roadmap sequencing: Archive writing already existed via maennchen/zipstream-php; this release closes the reading loop. Teams can now plan both "generate a ZIP on the fly" and "consume a ZIP on the fly" with one dependency, reducing the number of bespoke utilities to maintain.
  • Use cases worth scoping now: streamed ZIP downloads assembled per-request; selective extraction of a single entry from a large upload; passing zip streams into queue workers or cloud storage without temp files; CSV/JSONL exports streamed straight to S3 via Flysystem.
  • Risk/effort sizing: Small, focused dependency (one maintainer org, phpro, active Dependabot hygiene). Low integration cost, but it is a primitive, not a feature — budget PM/eng time for the surrounding response handling, error paths, and UX (progress, partial failures) rather than expecting it to ship a user-facing capability by itself.

When to Consider This Package

Adopt when:

  • You have concrete memory or timeout pressure on file handling — large exports, media downloads, or archive processing that currently fails or requires tuning memory_limit/max_execution_time.
  • You need ZIP entry-level reading (new in 1.4.0) inside Laravel jobs or controllers, and you want streaming semantics rather than ZipArchive::extractTo() to disk.
  • You want a single small dependency covering both streamed ZIP creation and streamed ZIP consumption.
  • Your team is comfortable composing low-level stream primitives with Laravel's HTTP response and Flysystem layers.

Look elsewhere when:

  • You need a full filesystem abstraction or cloud-disk behavior out of the box — reach for Flysystem/Laravel's Storage facade; this package complements rather than replaces it.
  • You need a turnkey feature: queued, chunked, resumable, signed-URL uploads/downloads are better served by packages like spatie/laravel-medialibrary, laravel-medialibrary-adjacent tooling, or direct use of S3 presigned URLs and multipart uploads.
  • You need advanced archive operations (encrypted ZIPs, split archives, complex compression tuning) — verify coverage against ZipArchive/zipstream-php capabilities before committing.
  • You're on a PHP/Laravel version not covered by the package's support matrix; check composer.json constraints first, since this release is feature-only and does not signal a compatibility reset.

How to Pitch It (Stakeholders)

For executives (one paragraph): This is a small, low-cost utility library that removes a hard technical ceiling on file-heavy features. As we grow exports, media handling, and partner data ingestion, the naive approach — loading files fully into memory — causes timeouts, failed jobs, and infrastructure spend on oversized workers. This library lets those operations run in constant memory. Release 1.4.0 adds the ability to read inside ZIP archives as a stream, which unlocks bulk-import and archive-processing features we previously would have had to hand-build. Recommendation: approve as a standard dependency for the streaming workstream; effort is low and the risk is contained.

For engineering: phpro/resource-stream gives you PSR-7/HTTP response factories for streams, strings, and files, and — as of 1.4.0 — a ZipStream factory for reading zip entries, complementing the existing write path via maennchen/zipstream-php. Use it to stream exports directly to the client or to Flysystem/S3 without temp files, and to walk uploaded archives entry-by-entry in queued jobs. Expect to write the response/error-handling glue yourself; this is a primitive, not a framework. Track the 1.4.0 bump of actions/checkout as CI hygiene only — no breaking changes, no deprecations, drop-in upgrade from 1.3.0.

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.
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource