rekalogika/file-server
A file server for Laravel that streams files from local or remote storage through controlled HTTP endpoints, with access control, range requests, caching headers, and clean URLs. Deliver private downloads, images, and media without exposing storage paths.
Architecture fit. The package is not a Laravel package — despite the framing, it originates from the rekalogika ecosystem, which is Symfony-leaning and built around a standalone FileInterface abstraction. Its job is narrow and well-scoped: accept a FileInterface handle, mint a short-lived URL, and serve or redirect to the underlying resource. That is a legitimate architectural seam, but it only fits applications that have already committed to rekalogika/file as their file abstraction. For a Laravel codebase that already relies on Illuminate\Filesystem and Storage::temporaryUrl(), adopting this pulls in an entire foreign abstraction layer to solve a problem the framework already solves.
Integration feasibility. Low-to-moderate. Because the dependency is on rekalogika/file rather than on the framework's native filesystem contracts, integration implies either (a) rewriting application file handling onto the rekalogika abstraction, or (b) writing an adapter that bridges Laravel's FilesystemAdapter into FileInterface. Option (b) is tractable but is custom code we would own and maintain, and it erodes the value of picking up the package in the first place.
Technical risk. The dominant risks are adoption and provenance, not code quality:
[READ-ONLY] and is a monorepo subtree split. Issues and PRs almost certainly route to a parent repo, so our contribution and support surface is one hop removed from where we file tickets.FileInterface abstraction itself, not from the serving mechanism.Key questions.
Stack fit. Poor for a Laravel-first shop, adequate for a Symfony shop already using rekalogika components. The honest read: this is a component that makes sense inside an existing rekalogika-based application and makes little sense as a bolt-on.
Migration path. There is no incremental path that avoids adopting rekalogika/file. If we proceed, we would sequence it as: introduce rekalogika/file alongside Laravel's filesystem, implement a bridge adapter for one storage backend, expose file-server behind a single new endpoint that does not displace any existing download route, and leave all current code paths untouched. Any approach that migrates existing file handling is a much larger program and should be evaluated as such, not smuggled in under a package adoption.
Compatibility. Two compatibility surfaces to clear before any code is written: PHP version range against our runtime matrix, and dependency stability against whatever version of rekalogika/file we can actually pin. With zero dependents, we should assume we are the first serious integrator and budget accordingly. PSR compliance for HTTP and container interfaces should be confirmed rather than assumed.
Sequencing. Treat as a spike, not a commitment. Timebox a one-engineer proof of concept: one file type, one backend, one endpoint, temporary URLs exercised in a staging environment including expiry and tampering cases. Decision gate on the spike is whether the abstraction earns its keep after the bridge adapter exists — if the adapter is as much code as the feature it enables, stop.
Maintenance. Single-maintainer risk with no visible commercial backing and no dependents to share the burden. Every upgrade path is a direct conversation with upstream, routed through a parent repository we do not control. Our TCO estimate should assume we own a fork within twelve months.
Support. Community-only. No SLA, no security advisory process we can rely on, no vendor to escalate to. For anything touching authenticated file access, that is a meaningful gap and should be priced into the decision.
Scaling. Depends entirely on the unanswered question above. Redirect-to-signed-URL scales trivially and offloads to the storage layer. Byte-streaming through PHP scales badly and puts file serving on the application tier, which is a capacity planning and egress cost concern. Do not approve adoption without a definitive answer.
Failure modes. Expected failure surface includes: expired or clock-skewed URLs, signing key mismatch or rotation without grace, storage adapter errors surfacing as 5xx rather than 404, and misconfigured visibility on the underlying object store. Each is operationally mundane but each is also ours to instrument and alert on, since upstream tooling almost certainly does not exist here.
Ramp-up. Modest but nonzero. The cost is not learning file-server — its surface is small — it is learning rekalogika/file's abstraction well enough to trust it in a production file path. Budget a day of reading for the spike engineer, plus review time for whoever owns the security review.
Recommendation. Do not adopt for a Laravel roadmap absent a specific unmet requirement around temporary URL serving. If such a requirement exists, run the timeboxed spike and be explicit that the output is a build-versus-adopt decision, with the likely outcome being a small internal implementation over the framework's native signing primitives.
How can I help you explore Laravel packages today?