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 Client Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

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:

  • Which PHP and PSR versions does the package actually support under the target Laravel runtime?
  • Is the target API strictly JSON:API 1.0, or does it use 1.1 features such as atomic operations?
  • Which features are required: includes, sparse fieldsets, pagination, filtering, sorting, relationship writes, error objects?
  • Can we fork and maintain the package internally, or is a thin in-house client cheaper?
  • Does the target API have stable contract tests we can run against this client?

Integration Approach

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:

  1. Run a compatibility audit on the target Laravel/PHP version.
  2. Spike one read-only endpoint through the package.
  3. Wrap it behind an application interface and add contract tests.
  4. Validate error handling, timeouts, and include/relationship behavior.
  5. Decide: fork and maintain, keep as temporary adapter, or replace with a small Laravel-native client.

Operational Impact

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.

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.
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels