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

Json Api Laravel Package

sycho/json-api

A Laravel/PHP package for building JSON:API-compliant APIs. It helps serialize resources, handle relationships and includes, and return standardized responses, making it easier to expose clean, spec-compliant endpoints with less boilerplate.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • API contract standardization (roadmap-level): This package is a data point in the "should our next public/partner API conform to JSON:API (jsonapi.org)?" decision. It demonstrates the minimum surface area needed to emit spec-compliant payloads (data/attributes/relationships/included, sparse fieldsets, pagination links) — useful for scoping that decision independent of the library itself.
  • Build vs. buy vs. adopt: Concretely supports the serializer-layer choice: (a) adopt a JSON:API library, (b) hand-roll response shaping, or (c) use framework-native resources (e.g., Laravel API Resources) and map to the spec later. A ~1-star, single-maintainer, essentially dormant MIT library — now with one patch release (v0.5.2) in 2+ years — is a "read the source and vendor if needed" input, not a dependency decision on its own.
  • Client consistency / mobile roadmap: If multiple clients (web, iOS, Android, third-party integrators) consume the same endpoints, JSON:API's compound documents and ?include= conventions can reduce per-client fetching logic. This package is a cheap way to prototype those payloads and validate the ergonomics before committing engineering time.
  • Third-party integration cost & documentation: Spec-aligned APIs lower onboarding cost for integrators already using JSON:API tooling (Ember Data, json-api-normalizer, etc.). Useful input when estimating partner-integration support load for a platform/ecosystem roadmap item.
  • Error and pagination standards: Informs whether to standardize error objects and pagination envelopes across services — a small but recurring source of client-side rework and support tickets. The v0.5.2 fix (validation of limit and filter parameters) is a useful reminder that query-parameter hardening, not payload shape, is where most of the real support burden lives.
  • Feature scoping for API v2: If a versioned API refresh is on the roadmap, this package helps estimate the true cost of "spec compliance" vs. "just JSON that looks like the spec," which is usually where timelines slip.
  • Not supported: vendor selection for a production public API, long-term maintenance commitments, or anything requiring a support contract or security responsiveness.

When to Consider This Package

Consider it when:

  • You have already decided (or are seriously prototyping) JSON:API as your response format and want a small, dependency-free PHP formatter to sanity-check payload shapes.
  • The codebase is plain PHP or a lightweight framework where framework-native serializers would fight you; the library's surface is small and readable enough to vendor into your repo.
  • The API is internal, low-traffic, or a spike; a near-dormant release cadence is tolerable because you intend to fork and own the serializer (a few hundred lines, MIT-licensed).
  • Your team is comfortable reading and pinning a package with minimal upstream activity, and you have a named owner for that fork.

Look elsewhere when:

  • It's a production or externally consumed API. One star, zero dependents, one maintainer, and a single patch release since April 2023 (v0.5.2, query-parameter validation) is a bus-factor-1 risk with no evidence of production hardening. The "opportunity" signal here is about the capability (JSON:API in PHP), not the package's readiness.
  • You're on Laravel and want the ecosystem bet. Laravel API Resources plus a thin spec-mapping layer, or a maintained JSON:API implementation, will have more eyes on it than this repo.
  • You need OpenAPI generation, validation, or spec conformance testing. This package emits responses; it does not give you a supported conformance story. Note that v0.5.2 hardens inbound limit/filter parsing — a correctness fix, not a validation framework.
  • Security/compliance review applies. Dormant dependencies with no documented CVE response process are hard to clear in regulated environments, even when the attack surface is small.
  • Nobody will own it. Adoption without a fork owner converts a 200-line problem into a permanent maintenance tax.

How to Pitch It (Stakeholders)

For executives (one paragraph): We're evaluating whether our APIs should follow the JSON:API standard, which would make integrations cheaper and give every client the same pagination, filtering, and relationship conventions. This specific package is evidence for that decision, not the recommendation: it shows the work required to emit compliant payloads is genuinely small, so the real question is whether we want the standard and who owns the serializer layer. I do not recommend shipping it as a production dependency — one maintainer, effectively dormant, no downstream users, and its latest release is a single one-line validation fix rather than a sign of active stewardship — but it remains a useful, MIT-licensed reference we can vendor or reimplement cheaply. Net: low cost either way, and the decision that matters is the standard, not the library.

For engineering:

  • MIT, pure PHP, no runtime baggage; the serialization surface is small enough to vendor and own if we take it.
  • v0.5.2 validates limit and filter parameters — a genuine correctness fix for query handling, but not evidence of renewed maintenance. Do not read it as a stability signal; there are no new features, and no conformance or validation tooling for responses.
  • Treat it as a reference implementation for a spike: prototype one or two endpoints, measure client-side payoff, then decide between a maintained JSON:API package and a hand-rolled spec mapper.
  • If adopted, pin and fork; add conformance and query-parameter tests on our side, since upstream activity is minimal.
  • Hard requirement for production: an owner, a test suite, and a documented upgrade path.

Recommendation: Decide on JSON:API as a convention first (spike, ~1 sprint). If yes, choose a maintained implementation or vendor this code with a named owner; if no, stop here at near-zero cost.

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.
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib