1 | <?php |
||
9 | class WebPushServiceProvider extends ServiceProvider |
||
10 | { |
||
11 | /** |
||
12 | * Register the application services. |
||
13 | * |
||
14 | * @return void |
||
15 | */ |
||
16 | 14 | public function register() |
|
22 | |||
23 | /** |
||
24 | * Bootstrap the application services. |
||
25 | * |
||
26 | * @return void |
||
27 | */ |
||
28 | 14 | public function boot() |
|
29 | { |
||
30 | 14 | $this->app->when(WebPushChannel::class) |
|
31 | 14 | ->needs(WebPush::class) |
|
32 | 14 | ->give(function () { |
|
33 | $webPush = new WebPush($this->webPushConfig()); |
||
34 | $webPush->setReuseVAPIDHeaders(true); |
||
35 | |||
36 | return $webPush; |
||
37 | 14 | }); |
|
38 | |||
39 | 14 | if ($this->app->runningInConsole()) { |
|
40 | 14 | $this->definePublishing(); |
|
41 | } |
||
42 | 14 | } |
|
43 | |||
44 | /** |
||
45 | * @return array |
||
46 | */ |
||
47 | protected function webPushConfig() |
||
79 | |||
80 | /** |
||
81 | * Define the publishable migrations and resources. |
||
82 | * |
||
83 | * @return void |
||
84 | */ |
||
85 | 14 | protected function definePublishing() |
|
99 | } |
||
100 |