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

Laravel5 Json Api Laravel Package

nilportugues/laravel5-json-api

Laravel 5 package for building APIs that follow the JSON API specification (jsonapi.org). It transforms Eloquent models and collections into spec-compliant responses, including relationships, pagination, errors, and content negotiation, with minimal setup and configuration.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • API contract standardization. Informs the decision to adopt JSON:API as the canonical wire format across web, mobile, and partner integrations, rather than growing bespoke JSON shapes per endpoint.
  • Build vs. buy (borrow) for the serialization layer. Replaces hand-rolled transformers and response mappers with spec-compliant resource objects, relationships, included compound documents, pagination links, sparse fieldsets, and standardized error documents.
  • Multi-client roadmap. A predictable, spec-validated payload lets iOS/Android/web clients share one contract and use generic JSON:API tooling (Ember Data, normalizers, API gateways with spec validation), reducing per-client parsing work.
  • Partner/B2B integration strategy. Spec compliance lowers onboarding cost and support load for external consumers who already speak JSON:API.
  • Feature scoping where payload shape matters. Compound documents (include) cut round trips; sparse fieldsets trim payloads for low-bandwidth clients — both become design levers rather than afterthoughts.
  • Pagination semantics as a contract decision. Release 2.4.7 makes the paginator default to Eloquent's per-page value, so page-size behavior now tracks the model/query rather than the serializer. Useful for consistency, but it is a behavioral change: confirm existing clients don't depend on the previously implicit default before rolling it out, and treat page size as part of the published contract.
  • Typical use cases: Laravel 5 backends exposing an API to multiple first-party clients, teams standardizing an existing ad-hoc REST surface, and products whose clients expect JSON:API semantics.

When to Consider This Package

Adopt when:

  • You are on Laravel 5.0–5.4 and need JSON:API-compliant responses without writing a transformer layer.
  • You are already using the underlying nilportugues/json-api core transformers and want the Laravel wiring (service provider, facade, spec-conformant exception/error handling).
  • Clients or tooling genuinely require JSON:API (Ember, spec-driven SDKs, contract validators).

Look elsewhere when:

  • Laravel 5.5+ — use native Eloquent API Resources for simpler needs, or laravel-json-api (actively maintained) for full spec compliance.
  • PHP 8 / Laravel 9–11 — the codebase is Laravel-5-era; a pagination patch (2.4.7) does not establish PHP 8 compatibility or a tested upgrade path.
  • You need vendor support, security patches, or a predictable release cadence. 2.4.7 is a one-line-class fix, not a sign of active stewardship — releases are sporadic and there is no visible dependent ecosystem to absorb risk. Re-verify maintenance status before committing; treat any prior "last release 2016" note as stale metadata rather than a current signal.
  • You don't need the full spec — plain REST with Resources or Fractal is lower overhead and easier to staff.

How to Pitch It (Stakeholders)

Executives: This is a thin adapter that makes our API responses conform to an open standard (JSON:API). It reduces integration friction with partners and client apps and eliminates custom response-shaping work — faster delivery, fewer contract bugs, cheaper onboarding. The latest release is a small pagination fix, which improves consistency but is not evidence of a maintained product — so approve it as a tactical fit for our existing Laravel 5 systems only, paired with a funded modernization path, not as a long-term platform bet.

Engineering: Drop-in JSON:API compliance on Laravel 5 — resource/relationship serialization, included compound documents, standard error objects, and service-provider wiring on top of nilportugues/json-api. 2.4.7 aligns default pagination with Eloquent's per-page, which removes a subtle source of inconsistency between our API layer and query layer — worth taking, but it changes default page size at the edges, so diff pagination links in tests before shipping. Adoption cost stays low; the risk profile is unchanged: no PHP 8 assurance, no dependent ecosystem, sporadic releases. Pin versions, vendor/fork if adopted, and treat it as a bridge. Recommendation: borrow the patterns now; migrate to Laravel's native API Resources or laravel-json-api at the next framework upgrade. Do not build a durable dependency on this package.

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.
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core