23
|
1 |
<?php |
|
2 |
|
|
3 |
namespace CorpusParole\Providers; |
|
4 |
|
|
5 |
use Illuminate\Support\ServiceProvider; |
|
6 |
use GuzzleHttp\Client; |
|
7 |
|
|
8 |
/** |
|
9 |
* guzzle Service Provider, inspired by https://github.com/urakozz/laravel-guzzle |
|
10 |
*/ |
|
11 |
class GuzzleServiceProvider extends ServiceProvider |
|
12 |
{ |
|
13 |
/** |
|
14 |
* Register the Guzzle provider |
|
15 |
* |
|
16 |
* @return GuzzleClient |
|
17 |
*/ |
|
18 |
public function register() |
|
19 |
{ |
|
20 |
$this->app->bind('guzzle', function() { |
|
21 |
$config = isset($this->app['config']['guzzle']) ? $this->app['config']['guzzle'] : []; |
|
22 |
return new Client($config); |
|
23 |
}); |
|
24 |
} |
|
25 |
} |