Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/knoxzin1/aura-filter-middleware
Middleware to filter zend-expressive requests using Aura.Filter
https://github.com/knoxzin1/aura-filter-middleware
auraphp filter middleware php psr-15 psr-7 zend-expressive
Last synced: 4 days ago
JSON representation
Middleware to filter zend-expressive requests using Aura.Filter
- Host: GitHub
- URL: https://github.com/knoxzin1/aura-filter-middleware
- Owner: knoxzin1
- License: mit
- Created: 2018-02-24T02:47:52.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-24T03:13:03.000Z (almost 7 years ago)
- Last Synced: 2024-10-31T14:05:16.561Z (about 2 months ago)
- Topics: auraphp, filter, middleware, php, psr-15, psr-7, zend-expressive
- Language: PHP
- Size: 23.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Aura Filter Middleware
[![Build Status](https://secure.travis-ci.org/knoxzin1/aura-filter-middleware.svg?branch=master)](https://secure.travis-ci.org/knoxzin1/aura-filter-middleware)
[![Coverage Status](https://coveralls.io/repos/github/knoxzin1/aura-filter-middleware/badge.svg?branch=master)](https://coveralls.io/github/knoxzin1/aura-filter-middleware?branch=master)Middleware to filter [Zend Expressive](https://github.com/zendframework/zend-expressive) requests using [Aura.Filter](https://github.com/auraphp/Aura.Filter).
## Requirements
* PHP >= 7.1
## Installation
This package is installable and autoloadable via Composer as [knoxzin1/aura-filter-middleware](https://packagist.org/packages/knoxzin1/aura-filter-middleware).
```sh
composer require knoxzin1/aura-filter-middleware
```
## ExampleAdd the middleware to your pipeline
```php
$app->pipe(AuraFilterMiddleware::class);
```Pass the desired filter to the router options
```php
[
'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.