Download the PHP package isaackearl/artisan-api without Composer
On this page you can find all versions of the php package isaackearl/artisan-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download isaackearl/artisan-api
More information about isaackearl/artisan-api
Files in isaackearl/artisan-api
Package artisan-api
Short Description An api service for Laravel or Lumen. Helps you send responses with the proper status and code. Uses Fractal for items and collections.
License MIT
Homepage https://github.com/isaackearl/artisan-api
Informations about the package artisan-api
Artisan API
An api service for Laravel or Lumen. Helps you send responses with the proper status and code. Uses Fractal for items and collections.
Setup/Install
Require it with Composer
Add the service provider to config/app.php
(Optional) Add the API facade in config/app.php
Usage
In your controllers you can do stuff like this:
There are alot of options. Include the ArtisanApiInterface in your controller constructor and you can use it without the facade.
You can do custom stuff too and chain methods
Take a look at the ArtisanApiInterface to see all the supported methods. You can find that here:
Transformers
Transformers allow you to control how the data is presented in the response of your API. A typical transformer looks like this:
You can generate a transformer with the make:transformer command
This package uses laravel-fractal as it's fractal implementation. Check out their docs on their github page for more specific usage information and examples.
Since we are using the laravel-fractal package you can also publish the laravel-fractal config to customize the response data.
Testing
Contributing
Please see CONDUCT for details.
Credits
- Isaac Earl
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of artisan-api with dependencies
doctrine/inflector Version ~1.1.0
doctrine/instantiator Version ~1.0.5
illuminate/http Version ~5.1
illuminate/pagination Version ~5.1
illuminate/routing Version ~5.1
illuminate/support Version ~5.1
spatie/laravel-fractal Version ^4.3