Skip to content

Commit 303f4d9

Browse files
committed
Refactor
1 parent a16a58f commit 303f4d9

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

src/WebPushServiceProvider.php

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,9 @@ public function boot()
3030
$this->app->when(WebPushChannel::class)
3131
->needs(WebPush::class)
3232
->give(function () {
33-
$webPush = new WebPush($this->webPushConfig(), [], 30, $this->clientOptionsConfig());
34-
$webPush->setReuseVAPIDHeaders(true);
35-
36-
return $webPush;
33+
return (new WebPush(
34+
$this->webPushAuth(), [], 30, config('webpush.client_options', [])
35+
))->setReuseVAPIDHeaders(true);
3736
});
3837

3938
$this->app->when(WebPushChannel::class)
@@ -46,21 +45,11 @@ public function boot()
4645
}
4746

4847
/**
49-
* Get Guzzle Request options from config file and
50-
* pass to WebPush.
51-
* @return array
52-
*/
53-
protected function clientOptionsConfig()
54-
{
55-
$webpush = config('webpush');
56-
57-
return $webpush['client_options'];
58-
}
59-
60-
/**
48+
* Ge the authentication details.
49+
*
6150
* @return array
6251
*/
63-
protected function webPushConfig()
52+
protected function webPushAuth()
6453
{
6554
$config = [];
6655
$webpush = config('webpush');

0 commit comments

Comments
 (0)