treehousetim / lumen-middleware
Various middleware for lumen
Installs: 229
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/treehousetim/lumen-middleware
Requires
- php: ^7.1 || ^8.0
README
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' ]] ); } ... }