Skip to content

Commit c892c2c

Browse files
[9.x] Pusher Client instance initialization (#39924)
* Added support for client in Pusher instance * Reverted accidental merge conflict changes * formatting Co-authored-by: Taylor Otwell <taylor@laravel.com>
1 parent 1873d2a commit c892c2c

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@
155155
"phpunit/phpunit": "Required to use assertions and run tests (^9.5.8).",
156156
"predis/predis": "Required to use the predis connector (^1.1.9).",
157157
"psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).",
158-
"pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^5.0|^6.0|^7.0).",
158+
"pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^6.0|^7.0).",
159159
"symfony/amazon-mailer": "Required to enable support for the SES mail transport (^6.0).",
160160
"symfony/cache": "Required to PSR-6 cache bridge (^6.0).",
161161
"symfony/filesystem": "Required to enable support for relative symbolic links (^6.0).",

src/Illuminate/Broadcasting/BroadcastManager.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Ably\AblyRest;
66
use Closure;
7+
use GuzzleHttp\Client as GuzzleClient;
78
use Illuminate\Broadcasting\Broadcasters\AblyBroadcaster;
89
use Illuminate\Broadcasting\Broadcasters\LogBroadcaster;
910
use Illuminate\Broadcasting\Broadcasters\NullBroadcaster;
@@ -214,8 +215,13 @@ protected function callCustomCreator(array $config)
214215
protected function createPusherDriver(array $config)
215216
{
216217
$pusher = new Pusher(
217-
$config['key'], $config['secret'],
218-
$config['app_id'], $config['options'] ?? []
218+
$config['key'],
219+
$config['secret'],
220+
$config['app_id'],
221+
$config['options'] ?? [],
222+
isset($config['client_options']) && ! empty($config['client_options'])
223+
? new GuzzleClient($config['client_options'])
224+
: null,
219225
);
220226

221227
if ($config['log'] ?? false) {

src/Illuminate/Broadcasting/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
}
3535
},
3636
"suggest": {
37-
"pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^5.0|^6.0|^7.0))."
37+
"pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^6.0|^7.0)."
3838
},
3939
"config": {
4040
"sort-packages": true

0 commit comments

Comments
 (0)