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

Symfony Json Request Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

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.

  • Adoption signal is effectively zero: 2 stars, 0 dependents, score 0.01. No downstream pressure means no latent bug discovery and no community regression testing. v0.3.0 does not move these numbers materially.
  • Behavioral overlap: if the listener ever were activated alongside Laravel's own JSON handling, you get two sources of truth for the body, with ambiguous ParameterBag precedence and potential double-decoding on large payloads.
  • Raw-body integrity: HMAC/webhook signature verification depends on the untouched input stream. Any abstraction that encourages reading the body through a transformed bag invites re-serialization bugs.
  • Relevance decay — now sharper: Symfony 6.3+ ships 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.
  • Untested matrix: adding Symfony 7 support via a drive-by PR is not evidence of a CI matrix across 6.4 and 7.x, PHP 8.2/8.3/8.4, and edge-case payloads.

Key questions for the maintainer/team:

  1. Which specific call sites fail today, and what does $request->json()/$request->all() return there?
  2. Are any services in the estate actually running Symfony rather than Laravel, where the bundle would be natively applicable?
  3. Does v0.3.0 ship a tested version/PHP matrix, or is Symfony 7 support asserted from a single PR? Is there a changelog policy and security disclosure process?
  4. Does the decoder handle malformed JSON, deep nesting limits, and charset negotiation predictably on Symfony 7?
  5. Would a FormRequest plus explicit json() calls remove the need entirely?

Integration Approach

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:

  • v0.3.0 nominally covers Symfony 7; confirm the PHP constraint against the platform baseline (8.2/8.3) and verify whether 6.4 and 7.x are both actually exercised in CI.
  • Pin exactly, commit the lockfile, and treat any transitive update as a reviewable change. Note that the widened constraint means a future composer update is now more likely to move this package without an explicit decision — pin it if it is ever admitted.
  • If any class is borrowed, vendor the code into 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):

  1. Day 1–2: Reproduce the reported failure in a test-only branch using Laravel's native APIs; document the exact gap.
  2. Day 3–4: If a gap is real (e.g., a middleware expecting ParameterBag semantics), implement a DecodeJsonBody middleware behind a feature flag, with tests for malformed JSON, empty body, wrong Content-Type, and oversized payloads.
  3. Day 5–6: Compare against the package's decoder on the same fixtures — use it as an oracle, not a dependency. Include Symfony 7 fixtures now that the package claims support.
  4. Day 7: Go/no-go with the platform owner; default outcome is "no dependency added."

Operational Impact

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:

  • Malformed JSON → silent empty bag instead of a 400, producing downstream validation errors that mask the real cause.
  • Content-Type mismatch (text/plain with a JSON body) → inconsistent behavior between the package and framework paths.
  • Silent key collision where body fields overwrite route or query parameters, enabling parameter-injection style bugs.
  • Signature verification failures if raw-body access is abstracted away.
  • Abandonment: no upstream patch path if a CVE lands in a transitive dependency, and no guarantee that a Symfony 8 release will be picked up.

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.

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.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console