haddowg/json-api-laravel

Laravel package for haddowg/json-api: idiomatic routing, content negotiation, validation, and an Eloquent data layer for spec-compliant JSON:API 1.1 endpoints.

Maintainers

Package info

github.com/haddowg/json-api-laravel

pkg:composer/haddowg/json-api-laravel

Transparency log

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-07-13 09:18 UTC

This package is auto-updated.

Last update: 2026-07-13 09:23:55 UTC


README

CI Latest Version PHP Version License

Part of the jsonapi.rest suite — a complete, spec-compliant JSON:API 1.1 stack for PHP: a framework-agnostic core, a Symfony bundle, this Laravel package, and a typed TypeScript client, bound together by one conformance-tested OpenAPI 3.1 contract.

A Laravel package that makes haddowg/json-api idiomatic in a Laravel application: declare a JSON:API type as a class and get the standard endpoint set — spec-compliant JSON:API 1.1 documents, content negotiation, validation, policy authorization, and an Eloquent data layer — with no controller, handler, or serializer wired by hand.

It is the Laravel twin of the Symfony bundle: both build on the same framework-agnostic core and project a byte-identical OpenAPI document for an identical domain, so a client generator consumes either backend unchanged.

Requirements

  • PHP ^8.3 (8.3 / 8.4 / 8.5)
  • Laravel ^12.0 || ^13.0 (via the illuminate/* components)

Install

composer require haddowg/json-api-laravel
php artisan vendor:publish --tag=jsonapi-config   # optional — customise servers, pagination, OpenAPI

The service provider is auto-discovered and core is pulled in transitively — there is nothing to register by hand.

Documentation

Full documentation is published at haddowg.github.io/json-api-laravel. Start with install and getting started, or browse the documentation index.

Core concepts (fields, relations, constraints, response value objects) live in the core documentation.

Demo

docker compose up serves the full twelve-type music-catalog example over HTTP — browse http://localhost:8080/api/albums and the interactive OpenAPI docs at http://localhost:8080/docs. See the Docker guide.

License

Released under the MIT License.