PSR-15/PSR-7 compliant middleware using jenssegers/optimus
PSR-15 compliant middleware using jenssegers/optimus
You can install the optimus-middleware library with composer:
$ composer require icanhazstring/optimus-middleware
For the middleware to work, your
Container needs a dependency to
You need to provide an instance with the configuration you need.
How to configure see: https://github.com/jenssegers/optimus
OptimusConfigProvider inside your
$aggregator = new ConfigAggregator([ ... \icanhazstring\Middleware\OptimusConfigProvider::class, ... ]);
Make sure the
OptimusConfigProvider is included before your autoload files!
If you want to change the attributes the middleware should decode, simply provide the
OptimusMiddleware::CONFIG_KEY inside your autoload configuration.
return [ \icanhazstring\Middleware\OptimusMiddleware::CONFIG_KEY => ['id'] ];