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 Transformer Laravel Package

qandidate/symfony-json-request-transformer

Symfony package that decodes JSON request bodies into standard request parameters, so forms, validation, and controllers handle JSON APIs without custom parsing. A lightweight request transformer for cleaner Symfony JSON endpoints.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

qandidate/symfony-json-request-transformer is a single-purpose Symfony bundle: an event listener on kernel.request that detects a JSON Content-Type, decodes the body, and replaces the request's parameter bag so controllers can read JSON fields like form fields. That is the entire surface area — roughly one listener class plus bundle registration.

  • Architecture fit — poor for a Laravel codebase. Laravel has no kernel.request event and no Symfony event-dispatcher contract in that shape; it uses an HTTP middleware pipeline. More importantly, the capability is already native: Illuminate\Http\Request::getInputSource() returns a decoded-JSON ParameterBag when isJson() is true, so $request->input()/$request->json() work out of the box. The package solves a problem Laravel does not have.
  • Integration feasibility — low, and value-destroying if forced. There is no Laravel service provider, no config, no package discovery. "Integrating" it means either shimming Symfony's HttpKernel event system into Laravel (a large, brittle change for a small feature) or porting the listener into a middleware — at which point you have rewritten ~40 lines rather than adopted a dependency. 0 dependents means no field evidence that anyone has done this successfully.
  • Technical risk — high, dominated by lifecycle, not code quality. The repository is archived and the last release is 2023-01-28; there will be no PHP 8.3/8.4 or Symfony 6.4/7 compatibility work, no security response, and no CVE triage. The code itself is small, MIT-licensed, and trivially forkable, so the risk is institutional carry cost rather than technical complexity. Behavioral risks to note even in a Symfony context: silent overwrite of existing request parameters (parameter injection/shadowing), uncaught decode exceptions surfacing as 500s instead of 400/422, and unbounded memory on large payloads.
  • Key questions. What requirement does this satisfy that $request->json() / input() does not? Is any part of the target system actually Symfony-based, and at which HttpKernel version? Who would own a fork, and against what upgrade cadence? Does our dependency policy permit archived packages in production, and what is the documented exit criterion? The metadata reinforces the answer: score 0.58 with an opportunity score of 17.11 and zero dependents reads as low-momentum, low-leverage.

Integration Approach

  • Stack fit. Laravel-only: not applicable — use native request parsing, no package needed. Laravel plus standalone Symfony components: still marginal, because symfony/http-foundation alone does not give you the event listener the package hooks into. Pure Symfony below 6.1: this is the only context where the package historically earned its place, and even there it is now superseded by Request::toArray() / getPayload() and the json request format introduced in 6.1.
  • Migration path. Prefer the platform primitive in both ecosystems: $request->json('field') or $request->input('field') in Laravel, $request->getPayload()->get('field') in Symfony ≥6.1. If a team genuinely needs a package-level abstraction — for example, uniform validation of JSON bodies across a mixed fleet — write a narrow middleware that calls json_decode with depth/size guards, returns 400 on JSON_ERROR_*, and emits a typed exception. That removes the archived dependency entirely at roughly a day of effort.
  • Compatibility. Expect composer constraints pinned to Symfony 4/5-era http-kernel and http-foundation. Verify before any spike: the package requires symfony/http-kernel, which Laravel does not pull in, so installing it drags a parallel HTTP stack into the dependency graph for no functional gain. Assume it will not resolve cleanly against Laravel 10/11 or Symfony 6.4/7 without --ignore-platform-reqs, which is itself a red flag.
  • Sequencing. (1) Confirm the native gap with a one-hour spike asserting $request->json() behavior on the actual stack. (2) If a gap exists, prototype the middleware locally rather than installing the package. (3) Run a dependency and license review that explicitly records archived status. (4) Only if the package is still indicated, fork under MIT, pin the fork, add tests for malformed JSON, content-type edge cases, and parameter shadowing, and name an owner. (5) Set a review date tied to the next framework major.

Operational Impact

  • Maintenance. This is the dominant cost. Archived status means the adopting team is the maintainer: every PHP minor and framework major requires someone to re-verify the listener. The fork itself is small and cheap to keep alive; the permanent, low-grade attention tax is the real expense, and it buys a feature the framework already ships.
  • Support. No vendor, no maintainer, no SLA, community-only issue history frozen at archive date. Incident response is entirely internal, and because there are zero dependents there is no external signal that a regression has already been found by someone else.
  • Scaling. Negligible: JSON decoding is linear in body size and trivially parallel across workers. The only practical concerns are double-decoding overhead if the framework also parses the body, memory ceilings on large payloads, and enforcing a max body size at the edge rather than in application code.
  • Failure modes. Malformed JSON raising an uncaught exception and returning 500 instead of 400/422; content-type sniffing mismatches (application/json; charset=utf-8, vendor +json types); parameter-bag shadowing that lets a JSON body override route or query parameters — a security-review item, not just a bug; deeply nested payloads hitting default depth limits; and ordering conflicts with other request-stage listeners or middleware.
  • Ramp-up. A competent PHP engineer understands the mechanism in under an hour; the difficulty is institutional, not technical. The knowledge that must be transferred is why not to adopt it — that Laravel and modern Symfony already decode JSON bodies — plus, if a fork is taken, the fork's owner, pinned version, and exit criteria. For a Laravel-first organization the defensible recommendation is to decline adoption, document the native alternative, and reserve fork-and-own consideration only for a concrete Symfony-side requirement that getPayload() cannot meet.
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.
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels
wazza/laravel-db-encryption
hokny/laravel-generator
vonsogt/backup
jengo/queues
jeremykenedy/laravel-observability
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums