PHPackages                             json-api-php/json-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. json-api-php/json-api

ActiveLibrary

json-api-php/json-api
=====================

JSON API specs (jsonapi.org) as a set of PHP classes

3.0.0(3y ago)184383.3k↑35.1%18[3 issues](https://github.com/json-api-php/json-api/issues)4MITPHPPHP &gt;=8.1

Since Mar 28Pushed 3y ago8 watchersCompare

[ Source](https://github.com/json-api-php/json-api)[ Packagist](https://packagist.org/packages/json-api-php/json-api)[ Fund](https://www.paypal.me/f3ath)[ RSS](/packages/json-api-php-json-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (36)Used By (4)

[JSON API](http://jsonapi.org) spec implemented in PHP 7. Immutable
===================================================================

[](#json-api-spec-implemented-in-php-7-immutable)

The goal of this library is to ensure strict validity of JSON API documents being produced.

JSON:

```
{
    "data": {
        "type": "articles",
        "id": "1",
        "attributes": {
            "title": "Rails is Omakase"
        },
        "relationships": {
            "author": {
                "data": {
                    "type": "people",
                    "id": "9"
                },
                "links": {
                    "self": "/articles/1/relationships/author",
                    "related": "/articles/1/author"
                }
            }
        }
    }
}
```

PHP:

```
