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

Php Json Api Laravel Package

tenantcloud/php-json-api

A Laravel package for building JSON:API compliant APIs, handling resource serialization, sparse fieldsets, filtering, sorting, pagination, and relationship includes so you can return spec-ready responses with minimal boilerplate.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit tenantcloud/laravel-json-api is a JSON:API specification layer for Laravel — it plugs in at the serialization/deserialization boundary (request document parsing, query-parameter handling, resource objects, relationships, error responses). v7.0.2 is a patch release containing a single fix: "Normalize filters in every request bag" (#44). Architecturally it is a drop-in: it sits alongside Eloquent/API Resources rather than replacing them, and does not introduce new services, drivers, or infrastructure. It fits cleanly into an existing Laravel HTTP layer where the team wants spec-compliant filter[...], include, fields[...], sort, and page[...] handling without hand-rolling a query-parameter parser.

Integration feasibility High. This is a semver patch bump (7.0.1 → 7.0.2), no new configuration surface, no new public API, no deprecations, and no migration steps. The changed surface is internal: filter normalization is now applied consistently across every request bag rather than a subset. Adoption is a composer constraint bump plus a regression pass on endpoints that consume filters. Effort is measured in hours, not sprints.

Technical risk Low, but not zero — the risk is behavioral rather than structural:

  • Key-shape drift. Normalization changes how filter keys are represented in the request bag. Any application code that reads raw filter input directly ($request->query('filter'), custom Filter classes, middleware reading the bag) rather than through the package's accessors could see different key casing/shape.
  • Nested filter semantics. If the app relies on nested or bracketed filter forms (filter[author.name]=x), confirm normalization preserves the intended hierarchy.
  • Prior workaround removal. If the team previously hand-normalized filter keys anywhere to compensate for inconsistency between request bags, that shim is now redundant and could double-apply.
  • No CVE/security content in this release; no forced upgrade pressure.

Key questions

  1. Which request bags were previously not normalized, and does our code path touch them (e.g., JSON:API requests with a body plus query filters, or non-standard content types)?
  2. Do we read filters via the package's filter API everywhere, or is there direct $request->query('filter') access anywhere in our codebase?
  3. Are the package's Laravel/PHP version constraints compatible with our current framework version, and is v7.x the line we are standardized on?
  4. Does our test suite cover filter behavior across multiple request bag types, or only the happy path?
  5. Is there an existing filter-normalization shim in our code that should now be deleted?

Integration Approach

Stack fit Standard Laravel + Eloquent stack, PHP 8.x. The package is a composer dependency with a service-provider registration and publishable config — no queue workers, no runtime daemons, no database schema changes. It is compatible with existing API Resources and middleware; there is no conflict with Sanctum/Passport auth or with pagination libraries.

Migration path Trivial by semver standards: update the composer constraint to ^7.0.2, run composer update tenantcloud/laravel-json-api, clear config/route caches, and execute the API test suite. There is no data migration and no publishable asset change expected. Because this is a patch on the 7.x line, if we are already on 7.0.x this is a same-minor-line upgrade requiring only a regression pass. If we are on 6.x or earlier, treat it as a major-version evaluation and confirm the 7.x upgrade guide before adopting — this release note alone does not describe that path.

Compatibility Patch-level: no breaking API changes, no dependency constraint changes signalled, no deprecations introduced. The only compatibility consideration is behavioral — applications that depended on the pre-fix (inconsistent) normalization behavior are now on the new, consistent behavior. That is the intended direction, but it is a behavior change nonetheless.

Sequencing

  1. Pin the constraint and update in a dedicated PR (no feature work mixed in).
  2. Run the full API test suite; specifically re-run any tests covering filters, sparse fieldsets, includes, sorting, and pagination together.
  3. Add or extend tests for filter parsing across request bag variants — this is the exact surface the fix touches and the most likely place a latent assumption lives.
  4. Grep for direct filter-query access and remove any redundant normalization shims.
  5. Deploy to staging, exercise representative GET collection endpoints with compound filters, then promote.
  6. Document the normalization behavior in the API conventions doc so consumers know filter key handling is now uniform.

Operational Impact

Maintenance Negligible incremental maintenance. One dependency line to track; patch releases like this are the low-cost kind. The main ongoing cost is the existing one: staying current with a package that tracks the JSON:API spec, which occasionally means absorbing spec-driven behavior changes.

Support No new support surface. Support risk concentrates in one place: consumer-facing filter behavior. If filter key normalization changes observable query semantics, API consumers may file "my filter stopped matching" tickets. Mitigate with a short changelog note to consumers if any filter key shape changes visibly in responses or request handling.

Scaling No scaling implications — this is request-parsing logic, not a hot-path data layer addition. Normalization is a per-request constant-cost operation. No new caching, no new I/O, no cardinality concerns.

Failure modes

  • Silent filter mismatch: the highest-probability failure. A filter that previously matched now returns a superset or empty set because key normalization altered the lookup. Detectable via collection-endpoint integration tests; not detectable via unit tests of controllers alone.
  • Double normalization: if app-level shims remain, filter keys may be normalized twice, producing mangled keys for nested filters.
  • Config cache staleness: standard Laravel failure mode after a dependency bump — cleared by config:clear/route:clear in deploy steps.
  • Rollback: clean — revert the composer lock and redeploy; no schema or state to unwind.

Ramp-up Near zero. Any Laravel developer familiar with the JSON:API conventions (filter, include, fields, sort, page) can work with this package without training. The only knowledge worth transferring is where in our codebase filters are read, so future contributors use the package accessors rather than raw query access — that single convention is what keeps this class of patch low-risk.

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.
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
frankyso/ipaymu
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core