server/src/app/Providers/GuzzleServiceProvider.php
author ymh <ymh.work@gmail.com>
Fri, 04 Mar 2016 19:18:28 +0100
changeset 139 8d688175513a
parent 23 037687868bc4
child 533 a557802f2b12
permissions -rw-r--r--
add proxy for bnf completion and sparql request + upgrade kernel + route

<?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);
        });
    }
}