enm/json-api-client
Abstract client-side PHP implementation of the JSON:API specification. Build requests with JsonApiClient using any PSR-18 HTTP client, execute them, and deserialize responses into documents and included resources via the bundled serializer and deserializer.
Architecture fit: This is a client-side JSON:API abstraction, not a Laravel package and not a server implementation. It fits only if the Laravel application consumes an external JSON:API service and needs request building plus response deserialization. It has no Laravel service provider, config, facade, or Eloquent integration, so the application must own all framework wiring.
Integration feasibility: Composer installation is straightforward, and the package is usable through PSR-18, PSR-7, and PSR-17 contracts. A Laravel integration would bind Enm\JsonApi\Client\JsonApiClient as a singleton with a PSR-18 client, URI factory, request factory, and stream factory. Laravel’s default HTTP client is not a PSR-18 contract, so a bridge or dedicated PSR-18 client is required.
Technical risk: High. The package is archived, last released in 2019, has negligible adoption, and has zero dependents. It likely predates current PHP 8.x and PSR interface versions. The recommended HTTP client in the README is also a concern. MIT licensing helps, but production use implies owning a fork, dependency upgrades, security patching, and compatibility testing.
Key questions:
Stack fit: Suitable only as an isolated adapter layer. Keep it behind an application-owned interface such as JsonApiGateway so controllers, jobs, and services do not depend directly on Enm\JsonApi\Client. Register the client in a service provider with configurable base URI, timeout, and PSR-18 client. Use a maintained PSR-18 implementation rather than the README’s legacy recommendation.
Migration path: Treat this as a spike or reference implementation, not a default dependency. If the target API is strategic, fork the package into a private repository, pin it, add PHP/Laravel compatibility tests, and upgrade PSR dependencies. If the integration is small, implement a minimal client around Laravel’s HTTP client and JSON:API document structures instead.
Compatibility: Verify PHP constraint, enm/json-api-common dependency, PSR-7/17/18 versions, and serializer behavior against real API responses. Confirm JSON:API 1.0 support and test edge cases: included resources, empty relationships, sparse fieldsets, pagination links, and error documents. The archived status means no upstream fixes for newer PHP deprecations or security issues in transitive dependencies.
Sequencing:
Maintenance: The package must be treated as internally owned software. Budget for dependency updates, PHP upgrades, PSR compatibility fixes, security patching, and regression tests. Archived status means no upstream bug fixes.
Support: No active upstream support and a very small community. Troubleshooting will rely on reading source, JSON:API documentation, and the separate enm/json-api-common docs. MIT licensing permits a fork, but that creates ongoing engineering ownership.
Scaling: Runtime overhead is likely modest because the library mainly serializes and deserializes JSON:API documents. Scaling risk is in HTTP behavior: connection reuse, timeouts, retries, rate limits, and concurrent requests must be handled by the PSR-18 client or Laravel job/queue infrastructure, not assumed from this package.
Failure modes: Expect malformed or non-compliant JSON:API responses to surface as deserialization exceptions. Missing includes, unexpected relationship structures, 4xx/5xx error documents, URI resolution errors, and misconfigured PSR factories are key risks. The package likely does not provide retries, circuit breaking, or detailed observability, so those must be added around it.
Ramp-up: Moderate. Engineers must understand JSON:API document structure and PSR abstractions, and the documentation is split across repositories. Because the package is archived, onboarding new team members carries knowledge-transfer risk.
TPM recommendation: Do not adopt as a core production dependency without a fork-and-own decision. Use it for a short compatibility spike or as a reference for JSON:API client behavior. For long-lived Laravel integrations, prefer a thin application-owned client with contract tests, or a maintained package with active Laravel/PHP support.
How can I help you explore Laravel packages today?