Download the PHP package gravure/laravel-json-api without Composer
On this page you can find all versions of the php package gravure/laravel-json-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download gravure/laravel-json-api
More information about gravure/laravel-json-api
Files in gravure/laravel-json-api
Package laravel-json-api
Short Description Native integration of the Json API specification.
License MIT
Informations about the package laravel-json-api
Laravel JSON api
This package assists at generating JSON API v1 compatible output.
Installation
Register the service provider in your config/app.php
under providers
:
Usage
An important element of this package is the ReplacesRequest
middleware that is automatically
active for any request that accepts application/vnd.api+json
content. The inject Request
object provides a set of helper subclasses, for instance for handling pagination or filtering.
Aside from that, by extending the abstract ResourceController or Controller one can easily generate Json documents based on the specification. The ResourceController in fact provides a complete Laravel ResourceController implementation, where it only needs a Repository to process database specific logic.
Example
This is a simple example with a Post
having one or more Comment
and a single author User
.
All versions of laravel-json-api with dependencies
tobscure/json-api Version ^0.3.0
illuminate/routing Version ~5.4
illuminate/database Version ~5.4
spatie/laravel-json-api-paginate Version 1.*