Skip to content

Middleware to filter zend-expressive requests using Aura.Filter

License

Notifications You must be signed in to change notification settings

knoxzin1/aura-filter-middleware

Repository files navigation

Aura Filter Middleware

Build Status Coverage Status

Middleware to filter Zend Expressive requests using Aura.Filter.

Requirements

  • PHP >= 7.1

Installation

This package is installable and autoloadable via Composer as knoxzin1/aura-filter-middleware.

composer require knoxzin1/aura-filter-middleware

Example

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.