Skip to content

Commit b000089

Browse files
[9.x] Expose pusher() and ably() (#40728)
* Expose pusher() and ably() * formatitng Co-authored-by: Taylor Otwell <[email protected]>
1 parent 0e5a7fe commit b000089

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

src/Illuminate/Broadcasting/BroadcastManager.php

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,17 @@ protected function callCustomCreator(array $config)
213213
* @return \Illuminate\Contracts\Broadcasting\Broadcaster
214214
*/
215215
protected function createPusherDriver(array $config)
216+
{
217+
return new PusherBroadcaster($this->pusher($config));
218+
}
219+
220+
/**
221+
* Get a Pusher instance for the given configuration.
222+
*
223+
* @param array $config
224+
* @return \Pusher\Pusher
225+
*/
226+
public function pusher(array $config)
216227
{
217228
$pusher = new Pusher(
218229
$config['key'],
@@ -228,7 +239,7 @@ protected function createPusherDriver(array $config)
228239
$pusher->setLogger($this->app->make(LoggerInterface::class));
229240
}
230241

231-
return new PusherBroadcaster($pusher);
242+
return $pusher;
232243
}
233244

234245
/**
@@ -239,7 +250,18 @@ protected function createPusherDriver(array $config)
239250
*/
240251
protected function createAblyDriver(array $config)
241252
{
242-
return new AblyBroadcaster(new AblyRest($config));
253+
return new AblyBroadcaster($this->ably($config));
254+
}
255+
256+
/**
257+
* Get an Ably instance for the given configuration.
258+
*
259+
* @param array $config
260+
* @return \Ably\AblyRest
261+
*/
262+
public function ably(array $config)
263+
{
264+
return new AblyRest($config);
243265
}
244266

245267
/**

0 commit comments

Comments
 (0)