--- a/server/src/app/Providers/GuzzleServiceProvider.php Sat Jun 10 08:33:03 2017 +0200
+++ b/server/src/app/Providers/GuzzleServiceProvider.php Sat Jun 10 17:57:34 2017 +0200
@@ -10,6 +10,13 @@
*/
class GuzzleServiceProvider extends ServiceProvider
{
+
+ private function bindToKey($key) {
+ $this->app->bind($key, function() {
+ $config = isset($this->app['config']['guzzle']) ? $this->app['config']['guzzle'] : [];
+ return new Client($config);
+ });
+ }
/**
* Register the Guzzle provider
*
@@ -17,9 +24,7 @@
*/
public function register()
{
- $this->app->bind('Guzzle', function() {
- $config = isset($this->app['config']['guzzle']) ? $this->app['config']['guzzle'] : [];
- return new Client($config);
- });
+ $this->bindToKey('Guzzle');
+ $this->bindToKey('GuzzleHttp\Client');
}
}