diff --git a/src/ChannelManagers/LocalChannelManager.php b/src/ChannelManagers/LocalChannelManager.php index 3cacbf4..913744b 100644 --- a/src/ChannelManagers/LocalChannelManager.php +++ b/src/ChannelManagers/LocalChannelManager.php @@ -179,7 +179,9 @@ class LocalChannelManager implements ChannelManager }); collect($channels) - ->reject->hasConnections() + ->reject(function ($channel) { + return $channel->hasConnections(); + }) ->each(function (Channel $channel, string $channelName) use ($connection) { unset($this->channels[$connection->app->id][$channelName]); }); diff --git a/src/Channels/Channel.php b/src/Channels/Channel.php index fd857e2..7cc7f37 100644 --- a/src/Channels/Channel.php +++ b/src/Channels/Channel.php @@ -156,7 +156,9 @@ class Channel public function broadcast($appId, stdClass $payload, bool $replicate = true): bool { collect($this->getConnections()) - ->each->send(json_encode($payload)); + ->each(function ($connection) use ($payload) { + $connection->send(json_encode($payload)); + }); if ($replicate) { $this->channelManager->broadcastAcrossServers($appId, null, $this->getName(), $payload);