server/src/app/Providers/GuzzleServiceProvider.php
author ymh <ymh.work@gmail.com>
Tue, 08 Nov 2016 18:23:01 +0100
changeset 405 f239c8c5bb94
parent 139 8d688175513a
child 533 a557802f2b12
permissions -rw-r--r--
migrate to rdf4j (2.1.1) from sesame (4.1.1)

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