PusherBeamsServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 9.8333
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Rich2k\PusherBeams;
4
5
use Illuminate\Support\ServiceProvider;
6
use Pusher\PushNotifications\PushNotifications;
7
8
class PusherBeamsServiceProvider extends ServiceProvider
9
{
10
    public function boot()
11
    {
12
        $this->app->when(PusherBeams::class)
13
            ->needs(PushNotifications::class)
14
            ->give(function () {
15
                $pusherConfig = config('broadcasting.connections.pusher');
16
17
                return new PushNotifications([
18
                    'secretKey' => array_get($pusherConfig, 'beams.secret_key'),
19
                    'instanceId' => array_get($pusherConfig, 'beams.instance_id'),
20
                ]);
21
            });
22
    }
23
}
24