Simplified API controller, inspired by Jeffrey Way. Compatible with Laravel 5+ and Lumen 5+.

2.0.1 2020-03-03 18:22 UTC

This package is auto-updated.

Last update: 2021-12-31 00:29:40 UTC


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

Basic Setup/Usage

use EventHomes\Api\ApiController;

class MyController extends Controller {

    use ApiController;
    public function index() {
        return $this->respond(['status' => 'hello world']);

Api Helper functions

Please browse through the source to see a full list.

//200 response

//201 response

//500 error

//422 error

//General error
$this->respondWithError('message here');

Add Fractal Helpers

Please use [https://github.com/eventhomes/laravel-fractalhelper]