knoxzin1/aura-filter-middleware

Middleware to filter requests using Aura.Filter

v0.2.0 2018-02-24 03:10 UTC

This package is not auto-updated.

Last update: 2024-04-22 05:38:25 UTC


README

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.