purwandi / responder
Transform your laravel eloquent model using fluent fractal API
dev-master
2016-08-23 01:34 UTC
Requires
- php: >=5.5.9
- illuminate/database: 5.3.*
- illuminate/support: 5.3.*
- league/fractal: ^0.13.0
Requires (Dev)
- phpunit/phpunit: >=4.8
This package is not auto-updated.
Last update: 2024-11-21 03:50:26 UTC
README
TLDR ;)
Installation
Install the package through Composer:
composer require purwandi/responder
Laravel
Registering the Service Provider
After updating Composer, append the following service provider to the providers key
in config/app.php
Purwandi\Responder\ResponderServiceProvider::class
Registering the Facade
If you like facades you may also append the Responder
facade to the aliases
key:
Usage
Using Facade
Optionally, you may use the Responder
facade to create responses:
return Responder::success($users);
Including Data
return Responder::with('blog')->success($users);
return Responder::with('blog', 'blog.comment')->success($users);