server/src/app/Providers/GuzzleServiceProvider.php
changeset 23 037687868bc4
child 139 8d688175513a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/server/src/app/Providers/GuzzleServiceProvider.php	Thu Dec 10 16:05:53 2015 +0100
@@ -0,0 +1,25 @@
+<?php
+
+namespace CorpusParole\Providers;
+
+use Illuminate\Support\ServiceProvider;
+use GuzzleHttp\Client;
+
+/**
+ * guzzle Service Provider, inspired by https://github.com/urakozz/laravel-guzzle
+ */
+class GuzzleServiceProvider extends ServiceProvider
+{
+    /**
+     * Register the Guzzle provider
+     *
+     * @return GuzzleClient
+     */
+    public function register()
+    {
+        $this->app->bind('guzzle', function() {
+            $config = isset($this->app['config']['guzzle']) ? $this->app['config']['guzzle'] : [];
+            return new Client($config);
+        });
+    }
+}