Completed
Pull Request — master (#23)
by
unknown
15:42 queued 05:37
created

ServiceProvider::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace NotificationChannels\Webhook\Providers;
4
5
use GuzzleHttp\Client;
6
use GuzzleHttp\ClientInterface;
7
use NotificationChannels\Webhook\WebhookChannel;
8
use Illuminate\Support\ServiceProvider as BaseProvider;
9
10
class ServiceProvider extends Baseprovider
11
{
12
    /**
13
     * Bootstrap any application services.
14
     *
15
     * @return void
16
     */
17
    public function boot()
18
    {
19
        $this->publishes([
20
            __DIR__.'/../config/config.php' => config_path('webhook-notifications.php'),
21
        ]);
22
23
        $this->mergeConfigFrom(
24
            __DIR__.'/../config/config.php', 'webhook-notifications'
25
        );
26
    }
27
28
    /**
29
     * Register any application services.
30
     *
31
     * @return void
32
     */
33
    public function register()
34
    {
35
        $this->app
36
            ->when(WebhookChannel::class)
37
            ->needs(ClientInterface)
38
            ->give(function ($app) {
39
                return new Client($app['config.webhook-notifications']['default-config']);
40
            });
41
    }
42
}
43