Middleware to filter Zend Expressive requests using Aura.Filter.
- PHP >= 7.1
This package is installable and autoloadable via Composer as knoxzin1/aura-filter-middleware.
composer require knoxzin1/aura-filter-middleware
Add the middleware to your pipeline
$app->pipe(AuraFilterMiddleware::class);
Pass the desired filter to the router options
[
'name' => 'foo',
'path' => '/fooo',
'middleware' => FooMiddleware::class,
'allowed_methods' => ['POST'],
'options' => [
'aura-filter' => FooFilter::class,
],
],
The resulting object will be avaiable with the validationResult
attribute name.