amani64 / api
Resuful response package for laravel with Fractal transformer
Installs: 11
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/amani64/api
Requires
- php: ^7.0
- illuminate/routing: ^5.8
- illuminate/support: ^5.8
- league/fractal: ^0.18
README
This package provide you restful json response.
Documentation
Create Factory class:
$factory = app(Factory::class);
Set custom serializer:
$factory->transformer()->getAdapter()->setSerializer($serializer);
In your Controller:
return $factory->collection($collection, MyTransformer::class, ['identifier'=> 'myData'])
License
This package is licensed under the BSD 3-Clause license.