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
Laravel Json Api

Laravel Json Api Laravel Package

cloudcreativity/laravel-json-api

A Laravel package for building JSON:API compliant APIs with Eloquent support, offering resource routing, validation, filtering, sorting, pagination, sparse fieldsets, and relationship includes out of the box.

View on GitHub
Deep Wiki
Context7

JSON API (jsonapi.org) package for Laravel applications.

Frequently asked questions about Laravel Json Api
How do I install cloudcreativity/laravel-json-api in a Laravel app?
Install it with Composer using composer require cloudcreativity/laravel-json-api. The service provider is auto-discovered, then publish the package config with the vendor:publish command. Use the Artisan generators such as make:json-api:schema, make:json-api:adapter, and make:json-api:validators to scaffold each resource. Finally register your API routes with a single call per namespace.
What Laravel and PHP versions does cloudcreativity/laravel-json-api support?
The package targets Laravel 8 through 10 with PHP 8.x, alongside Eloquent and MySQL or Postgres. Because new Laravel majors can lag in support, check the release history before planning a 24-month upgrade path. Treat the package as a supply-chain dependency with an owner rather than a set-and-forget Composer require.
How does laravel-json-api handle routing, schemas, adapters, and validators?
You declare a Schema, Adapter, and Validator per resource, and the package generates routing and request handling from those declarations. Schemas define the JSON:API resource shape, adapters build Eloquent queries and eager loads, and validators handle request validation. This makes it an opinionated replacement for the controller and serializer layer, not an add-on.
Does laravel-json-api support sparse fieldsets, filtering, sorting, pagination, and relationship includes?
Yes. It implements JSON:API 1.0 document structure, compound documents, relationship endpoints, sparse fieldsets, and the standard sort, filter, and pagination conventions. Because each enabled feature adds a behavior surface, test combinations such as sparse fieldsets with includes and relationship endpoints versus related links.
Can I use laravel-json-api with Sanctum or Passport authentication?
Yes. Authentication does not need rework because existing Sanctum or Passport middleware attaches at the route-group level. Authorization policies compose at the edges of the package's resource layer. You keep Laravel's normal auth flow and protect the JSON:API route groups.
How do I use laravel-json-api with a non-Eloquent data source?
You need a custom Adapter for any non-Eloquent source such as a search index or downstream service. Adapters reach into Eloquent query construction by default, so this is where most architectural surprises appear. Budget design time for the adapter contract before committing to the package.
Is cloudcreativity/laravel-json-api actively maintained and safe for production?
It has a small maintainer footprint with a single primary author and a modest community of about 781 GitHub stars, and it has historically lagged new Laravel major releases. That can block framework upgrades for weeks or months. The Apache-2.0 license makes forking or vendoring a legally viable contingency, but you should assign internal ownership.
Does laravel-json-api support JSON:API 1.1 features like atomic operations?
The package is a full implementation of JSON:API 1.0, not 1.1. Atomic operations and other JSON:API 1.1 features are outside that scope, so verify your consumer's contract before assuming support. If a client mandates 1.1 features, plan for custom work or a different library.
When should I avoid laravel-json-api and use Laravel's native JsonResource instead?
Avoid it for internal-only APIs, GraphQL or RPC-oriented clients, and teams standardized on OpenAPI-first contracts. In those cases Laravel's native JsonResource plus a thin serializer has a lower total cost of ownership. It is a strong fit only when strict JSON:API compliance is a stated requirement from a named consumer.
How should I evaluate or spike laravel-json-api before committing?
Run a 5 to 10 engineer-day spike covering one read-only resource with two relationships, sparse fieldsets, and pagination. That is enough to produce a credible go/no-go and an effort estimate for the remaining resources. Decide up front who arbitrates the go/no-go and which resource is the thinnest viable slice.
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.
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect
youbar/easy-crud
c-point-labs/laravel-hostyourai
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo