-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathServiceProvider.php
More file actions
39 lines (35 loc) · 1023 Bytes
/
ServiceProvider.php
File metadata and controls
39 lines (35 loc) · 1023 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
namespace Baorv\Cleverreach;
use Baorv\CleverReach\Contracts\HttpClientContract;
use Baorv\CleverReach\Http\GuzzleHttpClient;
use Illuminate\Support\ServiceProvider as LaravelServiceProvider;
class ServiceProvider extends LaravelServiceProvider
{
/**
* Perform post-registration booting of services.
*
* @return void
*/
public function boot()
{
$this->publishes([
__DIR__ . '/../cleverreach.php' => config_path('cleverreach.php'),
], 'config');
}
/**
* Register bindings in the container.
*
* @return void
*/
public function register()
{
$this->mergeConfigFrom(__DIR__ . '/../cleverreach.php', 'cleverreach');
$this->app->singleton(HttpClientContract::class, function () {
return new GuzzleHttpClient(
config('cleverreach.client_id'),
config('cleverreach.client_secret'),
config('cleverreach.access_token')
);
});
}
}