Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/icanhazstring/optimus-middleware
PSR-15/PSR-7 compliant middleware using jenssegers/optimus
https://github.com/icanhazstring/optimus-middleware
expressive middleware optimus psr-15 psr-7
Last synced: 2 days ago
JSON representation
PSR-15/PSR-7 compliant middleware using jenssegers/optimus
- Host: GitHub
- URL: https://github.com/icanhazstring/optimus-middleware
- Owner: icanhazstring
- License: mit
- Created: 2018-05-20T13:51:25.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-05-20T16:20:05.000Z (over 6 years ago)
- Last Synced: 2024-12-13T00:06:36.616Z (about 2 months ago)
- Topics: expressive, middleware, optimus, psr-15, psr-7
- Language: PHP
- Homepage:
- Size: 9.77 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# expressive-optimus-middleware
PSR-15 compliant middleware using jenssegers/optimus[![Build Status](https://api.travis-ci.org/icanhazstring/optimus-middleware.svg?branch=master)](https://travis-ci.org/icanhazstring/optimus-middleware)
## Install
You can install the *optimus-middleware* library with composer:
```bash
$ composer require icanhazstring/optimus-middleware
```## Configuration
### General dependencies
For the middleware to work, your `Container` needs a dependency to `Optimus`.
You need to provide an instance with the configuration you need.How to configure see: https://github.com/jenssegers/optimus
### Using expressive
Include the `OptimusConfigProvider` inside your `config/config.php`:
```php
$aggregator = new ConfigAggregator([
...
\icanhazstring\Middleware\OptimusConfigProvider::class,
...
]);
```Make sure the `OptimusConfigProvider` is included before your autoload files!
#### Change decoded attributes
If you want to change the attributes the middleware should decode, simply provide the
`OptimusMiddleware::CONFIG_KEY` inside your autoload configuration.```php
return [
\icanhazstring\Middleware\OptimusMiddleware::CONFIG_KEY => ['id']
];
```