enm/json-api-common
JSON API Common provides shared PHP classes and interfaces for building JSON:API-compliant servers and clients. It powers enm/json-api-server and enm/json-api-client, covering resources, relationships, links, documents, errors, and requests.
Architecture fit. enm/json-api-common is not a Laravel package and not even a standalone implementation — it is the framework-agnostic value-object and interface layer shared between enm/json-api-server and enm/json-api-client. It supplies the JSON:API vocabulary (resources, relationships, documents, links, errors, request/response abstractions) but no HTTP layer, no routing, no Eloquent mapping, no service provider, no config. In a Laravel app, adopting it means adopting the sibling server package and writing all the Laravel glue ourselves. Against Laravel-native options (laravel-json-api/laravel-json-api, Laravel's own Eloquent API Resources, or hand-rolled transformers), it carries no framework affinity. Its only genuine differentiator is strict JSON:API spec symmetry between a PHP client and a PHP server built on the same primitives.
Integration feasibility. Low to moderate. Composer install is trivial, but the package is archived (last release 2020-12-14) and its PHP constraint almost certainly predates PHP 8.1+ and Laravel 9–12 support. Expect to fork or pin. Zero public dependents means no ecosystem validation — we would be the first party exercising this code against a modern Laravel runtime.
Technical risk. High, concentrated in three areas:
Key questions.
Stack fit. Poor as a direct dependency; useful at most as a design reference. It assumes a PHP application that already has a JSON:API document model and wants typed structures for it. Laravel idioms are entirely absent, so integration cost lands on us: a service provider, config publishing, exception mapping into Laravel's handler, and serialization into JsonResponse.
Migration path. If we proceed, treat it as a spike, not a migration:
composer require enm/json-api-common enm/json-api-server against our exact PHP/Laravel matrix.Compatibility. Verify the composer.json PHP constraint against our runtime, PSR-7/PSR-17 dependency versions (likely ^1.0/^2.0, possibly legacy zendframework/*), and whether the server package's middleware can be expressed as Laravel middleware without rewriting. The Symfony HttpFoundation ↔ PSR-7 bridge is the likely friction point.
Sequencing. Only after the spike succeeds: fork to an internal namespace, pin a PHP CI matrix, add static analysis, write contract tests against the JSON:API spec, then wire a first production resource. Never adopt this as a transitive dependency of something we don't control.
Maintenance. This is the dominant cost. Archived plus zero dependents means we inherit the entire maintenance surface — PHP version bumps, deprecation fixes, dependency security advisories — for a library of value objects we could otherwise write in a few hundred lines. Budget a named fork maintainer and a quarterly compatibility review.
Support. No upstream issue triage, no maintainer to escalate to. Internal documentation must replace the README, which is thin and now frozen (trait, resources, collections, links, documents, errors, requests). Onboarding cost is real: engineers must learn both this library's conventions and the JSON:API spec to use it correctly.
Scaling. A non-issue. The package is pure PHP data structures; CPU and memory cost is negligible relative to serialization and database work. It will never be the bottleneck — the surrounding server package and query layer will be.
Failure modes.
Ramp-up. Low for the API surface (a handful of interfaces and value objects); high for the context — JSON:API document/relationship/error semantics plus the sibling packages' conventions. Realistically one to two weeks for a mid-level engineer to become productive on a single resource, plus spec study. Given the score (1.79), archived status, and mature alternatives, expected value is negative unless strict JSON:API symmetry between a PHP client and a PHP server is a genuine, locked requirement.
How can I help you explore Laravel packages today?