This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.
This package is abandoned and no longer maintained. The author suggests using the ipub/json-api-document package instead.

JSON:API document factory

v0.0.4 2019-11-09 20:26 UTC

This package is auto-updated.

Last update: 2020-03-17 20:02:13 UTC


Latest Stable Version Composer Downloads License

Small library for creating json:api document from object.


The best way to install ipub/json-api-document is using Composer:

$ composer require ipub/json-api-document

Create document

$content = $response->getContent();

$document = new \IPub\JsonAPIDocument\Document(json_encode($content));

Get data type

  "links": {
    "self": "http://example.com/articles/1"
  "data": {
    "type": "articles",
    "id": "1",
    "attributes": {
      "title": "JSON:API paints my bikeshed!"
    "relationships": {
      "author": {
        "links": {
          "related": "http://example.com/articles/1/author"
$type = $document->getResource()->getType(); // articles


Homepage https://www.ipublikuj.eu and repository http://github.com/iPublikuj/json-api-document.