Simplified API controller, inspired by Jeffrey Way. Compatible with Laravel 5+ and Lumen 5+. Forked from eventhomes
ftxrc/apicontroller is a Laravel package for simplified api controller, inspired by jeffrey way. compatible with laravel 5+ and lumen 5+. forked from eventhomes.
It currently has 2 GitHub stars and 37 downloads on Packagist (latest version 0.1.8).
Install it with composer require ftxrc/apicontroller.
Discover more Laravel packages by ftxrc
or browse all Laravel packages to compare alternatives.
Last updated
A simple api controller helper trait, compatible with Lumen 5+ and Laravel 5+. The goal of this project is to make creating API projects simple. Inspired by Jeffrey Way (https://www.laracasts.com)
composer require eventhomes/laravel-apicontroller
...
use EventHomes\Api\ApiController;
class MyController extends Controller {
use ApiController;
public function index() {
return $this->respond(['status' => 'hello world']);
}
}
Please browse through the source to see a full list.
//200 response
$this->respond();
//201 response
$this->respondCreated();
//500 error
$this->respondServerError();
//422 error
$this->respondUnprocessable();
//General error
$this->respondWithError('message here');
Please use [https://github.com/eventhomes/laravel-fractalhelper]