gowork/symfony-json-request
A Symfony package for handling JSON HTTP requests more cleanly. It helps decode application/json request bodies and integrate them with Symfony's Request object and controllers, simplifying JSON API endpoints and request data access.
Scope note: The package is a Symfony bundle (gowork/symfony-json-request), not a Laravel package. It solves a Symfony HttpFoundation gap — $request->request is only populated from form-encoded bodies, so JSON payloads never land in the ParameterBag. Evaluating it for a Laravel codebase therefore means evaluating a dependency whose core mechanism Laravel already implements natively.
v0.3.0 delta: The release adds Symfony 7 support (single community PR, no API or behavior changes). This is a compatibility matrix expansion, not a feature. It does not alter the package's core mechanism, does not add a Laravel integration path, and does not change the recommendation. Two secondary effects are worth recording: (a) the package now resolves cleanly against symfony/http-foundation 7.x, which is the same major Laravel 11+ depends on, so composer require will succeed where it may previously have hit a constraint conflict — raising the temptation to adopt without raising the value; and (b) it demonstrates the maintainer will merge external PRs, a weak positive maintenance signal, though one merged PR is not a support commitment.
Architecture fit — poor. Laravel's Illuminate\Http\Request overrides all(), input(), and json() to read from the decoded JSON body, so the problem statement the package addresses does not exist in a Laravel app. Worse, the package's value is delivered through a kernel.request event listener; Laravel does not dispatch Symfony HttpKernel events (it has its own Illuminate\Contracts\Http\Kernel and router pipeline). Installing it would register config and classes that never fire. Making it work requires writing a Laravel middleware that calls into the package's decoder — at which point the package is a wrapper around json_decode(file_get_contents('php://input')).
Integration feasibility — technically trivial, functionally pointless. Composer install now succeeds more readily against a modern Laravel stack (both sit on symfony/http-foundation 7.x), but there is still no supported path to activate the bundle's listener without pulling in symfony/http-kernel and a second request pipeline, which would conflict with Laravel's own bootstrapping. The only defensible use remains importing the decoder class directly, which is a ~15-line function.
Technical risk — moderate to high, mostly supply chain.
ParameterBag precedence and potential double-decoding on large payloads.Request::getPayload() / toArray(). The package's newest supported version (Symfony 7) is precisely the version where its reason to exist is weakest, so v0.3.0 modernizes support for an API surface that already supersedes it.Key questions for the maintainer/team:
$request->json()/$request->all() return there?FormRequest plus explicit json() calls remove the need entirely?Stack fit — none for Laravel. Recommend a hard "no" for the Laravel application tier. The idiomatic equivalents are already first-party: $request->json('key'), $request->all() (merges query/route/JSON), FormRequest validation, and $request->validate(). These are documented, tested by the framework, and covered by Laravel's security advisories. v0.3.0 does not change this.
Migration path — N/A (greenfield non-adoption). Nothing to migrate; the decision is to not introduce a dependency. If a legacy Symfony service exists in the estate that needs JSON-to-bag behavior, prefer $request->getPayload() on Symfony 6.3+ and treat this package as a reference implementation only. For any Symfony 7 service in the estate, getPayload() is the answer and this bundle is redundant.
Compatibility considerations if overridden:
composer update is now more likely to move this package without an explicit decision — pin it if it is ever admitted.app/Support with attribution rather than depending on the repository — MIT permits this and it removes the supply-chain surface.Sequencing (two-week spike, if the request survives triage):
ParameterBag semantics), implement a DecodeJsonBody middleware behind a feature flag, with tests for malformed JSON, empty body, wrong Content-Type, and oversized payloads.Maintenance — unfavorable. Single-maintainer repository, negligible adoption, no visible ecosystem. v0.3.0 shows the maintainer will accept a compatibility PR, which is mildly reassuring for continued existence, but there is still no release cadence, deprecation policy, or evidence of a maintained test matrix. Budget as if you had written it yourself, with none of the code familiarity.
Support — self-support only. No community to escalate to; internal ownership must be assigned before adoption. A merged community PR is not a support channel.
Scaling — neutral. Decoding a JSON body is O(payload). The real scaling concern is accidental duplication: if both the package and Laravel's request decode the body, memory per request roughly doubles for large payloads — relevant under Octane, where per-request allocation and worker memory ceilings are tighter. Avoid any design that eagerly decodes bodies for routes that never read them.
Failure modes to instrument:
Content-Type mismatch (text/plain with a JSON body) → inconsistent behavior between the package and framework paths.Ramp-up — low but negative-value. Any PHP developer can reimplement this in minutes; the cost is not learning it, it is the permanent explanation burden in code review and incident response ("why is this two-star Symfony bundle in a Laravel app?"). That friction discourages the exploratory debugging behavior you want during incidents.
TPM recommendation: Reject as a production dependency across the Laravel estate. v0.3.0 is a compatibility maintenance release and does not change the calculus — it makes the package installable on a modern Laravel stack without making it useful there. Approve at most a 2-day spike to confirm the underlying problem, followed by a first-party middleware or explicit json() usage. Revisit only if the estate acquires genuine Symfony HttpKernel services, and even then evaluate Symfony's native getPayload() first. The 0.01 score, 2 stars, and 0 dependents remain the correct signal.
How can I help you explore Laravel packages today?