JSONApi.org implementation for Silex framework.
Based on Nil Portugués Caldero PHP Json Api Package php-json-api.
** Step 1: Download Service Provider
To install with composer just open a terminal and type:
$ composer require mauro-moreno/silex-jsonapi
** Step 2: Enable Service Provider
To enable
<?php
$app = new Silex\Application;
$app['mappers'] = []; // Array of mapping classes
$app->register(new MauroMoreno\JsonApi\JsonApiServiceProvider);
The following JsonApiResponseTrait
methods are provided to return the right headers and HTTP status codes are available:
private function resourceCreated($json);
private function resourceDeleted($json);
private function resourceNotFound($json);
private function resourceProcessing($json);
private function resourceUpdatedResponse($json);
private function response($json);
private function unsupportedAction($json);