mirror of
https://github.com/archtechx/tenancy.git
synced 2026-08-06 16:54:05 +00:00
Use $centralBroadcaster->getChannels() to get the channels instead of using invade() for that
We still need to use invade() to obtain the channelOptions.
This commit is contained in:
parent
d535b28d67
commit
81d41b4690
1 changed files with 5 additions and 5 deletions
|
|
@ -98,15 +98,15 @@ class BroadcastingConfigBootstrapper implements TenancyBootstrapper
|
|||
// Since Laravel only ever uses the default broadcaster's channel auth closures for broadcasting auth,
|
||||
// we only have to pass the channel closures to the default broadcaster.
|
||||
//
|
||||
// The $channels property and the channel() method aren't part of the Broadcaster contract -- they come
|
||||
// The channel() and getChannels() methods aren't part of the Broadcaster contract -- they come
|
||||
// from the abstract Broadcaster class, so the closures can only be copied between broadcasters extending it
|
||||
// (which all of Laravel's default broadcasters, e.g. PusherBroadcaster, do).
|
||||
if ($centralBroadcaster instanceof Broadcaster && $tenantBroadcaster instanceof Broadcaster) {
|
||||
// invade() because channels can't be retrieved through any of the broadcaster's public methods
|
||||
$centralBroadcaster = invade($centralBroadcaster);
|
||||
// invade() because the channel options can't be retrieved through any of the broadcaster's public methods
|
||||
$channelOptions = invade($centralBroadcaster)->channelOptions;
|
||||
|
||||
foreach ($centralBroadcaster->channels as $channel => $callback) {
|
||||
$tenantBroadcaster->channel($channel, $callback, $centralBroadcaster->retrieveChannelOptions($channel));
|
||||
foreach ($centralBroadcaster->getChannels() as $channel => $callback) {
|
||||
$tenantBroadcaster->channel($channel, $callback, $channelOptions[$channel] ?? []);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue