Skip to content

attus74/jsonapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

JSON:API

No Maintenance Intended

Simple JSON:API Serialization package

use Attus\JsonApi\Entity;
use Attus\JsonApi\Response;

$entity = new Entity();
$entity->setId($myId);
$entity->setType($myType);
$entity->setLink(['self', 'href'], $myLink);

$entity->setAttribute($name, $value);
$entity->setRelationship($name, $myRelationship);

$data = $entity->getData();

return new Response($data);