| Package Data | |
|---|---|
| Maintainer Username: | lostincode |
| Maintainer Contact: | roundedvision@gmail.com (Bill Richards) |
| Package Create Date: | 2015-06-19 |
| Package Last Update: | 2020-03-03 |
| Home Page: | |
| Language: | PHP |
| License: | MIT |
| Last Refreshed: | 2025-10-31 03:03:31 |
| Package Statistics | |
|---|---|
| Total Downloads: | 94,136 |
| Monthly Downloads: | 170 |
| Daily Downloads: | 1 |
| Total Stars: | 8 |
| Total Watchers: | 4 |
| Total Forks: | 2 |
| Total Open Issues: | 0 |
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]