mtarld/json-encoder-bundle
Symfony bundle that integrates mtarld/json-encoder into your app, letting you encode and decode PHP objects to and from JSON with support for denormalization, validation, and typed collections.
memory_limit under load. This package is useful as prior art for that decision, not as a dependency for it.yield from a generator into json_encode per record, or Symfony's StreamedJsonResponse), and skip the install. This is a legitimate and cheap outcome that still de-risks a roadmap item.Adopt only if all of the following hold:
StreamedJsonResponse (available in Laravel too, since it ships symfony/http-foundation) or plain generators plus json_encode — has been evaluated and rejected for a concrete, documented reason.Look elsewhere (in practice: always, for this one):
response()->stream(), StreamedJsonResponse, LazyCollection, and chunked JsonResponse construction. That covers the overwhelming majority of real streaming needs with maintained, first-party code.json_encode on a well-shaped array is faster and simpler than any abstraction over it.To executives: This is a low-value evaluation that resolved quickly and cheaply. The package is an archived, single-maintainer Symfony bundle with negligible adoption and no dependents — it does not meet our bar for a production dependency and will not enter the vendor risk register. The useful takeaway is the pattern it demonstrates: streaming JSON output to keep memory flat on large responses. We can capture that pattern with maintained, first-party components and no new dependency, which is the recommendation.
To engineering: It is a Symfony bundle wrapping a streaming/incremental JSON encoder — services in the container, serializer integration, and the ability to emit JSON as records are produced rather than buffering the whole structure. The concept is sound and worth a short spike if we have export or large-payload endpoints that are memory-bound. The package itself is not: archived since 2024, one maintainer, zero dependents, ten stars. Recommended path is a timeboxed spike (1–2 days) against Symfony's StreamedJsonResponse or a generator-plus-json_encode implementation, using this repo as a reference for API shape only. No production dependency, no fork, no procurement. If the spike proves the pattern out, we write an ADR and move on.
How can I help you explore Laravel packages today?