This plugin integrates a generic way to include all middleware.
- PHP 7.0 or above
- Guzzle Bundle
Using composer:
$ composer require wizbit/guzzle-bundle-middleware-plugin
# app/AppKernel.php
new EightPoints\Bundle\GuzzleBundle\EightPointsGuzzleBundle([
new Wizbit\Bundle\GuzzleBundleMiddlewarePlugin\GuzzleBundleMiddlewarePlugin(),
])
# app/config/config.yml
eight_points_guzzle:
clients:
api_payment:
base_url: "http://api.domain.tld"
# define headers, options
# plugin settings
plugin:
middleware:
- '@my.middleware.service'