mirror of
https://github.com/archtechx/tenancy.git
synced 2026-08-06 06:54:03 +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,
|
// 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.
|
// 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
|
// 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).
|
// (which all of Laravel's default broadcasters, e.g. PusherBroadcaster, do).
|
||||||
if ($centralBroadcaster instanceof Broadcaster && $tenantBroadcaster instanceof Broadcaster) {
|
if ($centralBroadcaster instanceof Broadcaster && $tenantBroadcaster instanceof Broadcaster) {
|
||||||
// invade() because channels can't be retrieved through any of the broadcaster's public methods
|
// invade() because the channel options can't be retrieved through any of the broadcaster's public methods
|
||||||
$centralBroadcaster = invade($centralBroadcaster);
|
$channelOptions = invade($centralBroadcaster)->channelOptions;
|
||||||
|
|
||||||
foreach ($centralBroadcaster->channels as $channel => $callback) {
|
foreach ($centralBroadcaster->getChannels() as $channel => $callback) {
|
||||||
$tenantBroadcaster->channel($channel, $callback, $centralBroadcaster->retrieveChannelOptions($channel));
|
$tenantBroadcaster->channel($channel, $callback, $channelOptions[$channel] ?? []);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue