Skip to content

Commit a16a58f

Browse files
committed
Merge branch 'pr/118'
2 parents 7ab619d + a791733 commit a16a58f

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

config/webpush.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@
3030
*/
3131
'database_connection' => env('WEBPUSH_DB_CONNECTION', env('DB_CONNECTION', 'mysql')),
3232

33+
/**
34+
* The Guzzle client options used by Minishlink\WebPush.
35+
*/
36+
'client_options' => [],
37+
3338
/**
3439
* Google Cloud Messaging.
3540
* @deprecated

src/WebPushServiceProvider.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function boot()
3030
$this->app->when(WebPushChannel::class)
3131
->needs(WebPush::class)
3232
->give(function () {
33-
$webPush = new WebPush($this->webPushConfig());
33+
$webPush = new WebPush($this->webPushConfig(), [], 30, $this->clientOptionsConfig());
3434
$webPush->setReuseVAPIDHeaders(true);
3535

3636
return $webPush;
@@ -45,6 +45,18 @@ public function boot()
4545
}
4646
}
4747

48+
/**
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+
4860
/**
4961
* @return array
5062
*/

0 commit comments

Comments
 (0)