treehousetim / lumen-middleware

Provides a trait to use in controllers in a lumen project to provide common output fields

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

lumen-middleware

jsonStandardResponse

Provides a standard way of providing JSON formatted output no matter what the application sends

For all endpoints

Modify your app.php

$app->middleware([
    treehousetim\lumen_middleware\jsonStandardResponse::class
]);

idUUID

Automatically validates uuid's in url parameters based on routes with the first parameter intended to be a UUID Only validates it is present and is a proper UUID.

Use in a controller's __construct method

class MyController extends Controller
{
 public function __construct()
    {
        $this->middleware( 'ID_UUID',
            ['only'=>[
                'get',
                'update',
                'destroy'
            ]]
        );
    }
...
}

About

Provides a trait to use in controllers in a lumen project to provide common output fields

License:MIT License


Languages

Language:PHP 100.0%