From a167974feb3dcf9037ec5ba6ddab7672bb3ba2d1 Mon Sep 17 00:00:00 2001 From: Joe Dixon Date: Fri, 17 Nov 2023 22:45:07 +0000 Subject: [PATCH] wip --- src/Managers/ChannelManager.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Managers/ChannelManager.php b/src/Managers/ChannelManager.php index 6b57a03b..12624163 100644 --- a/src/Managers/ChannelManager.php +++ b/src/Managers/ChannelManager.php @@ -56,6 +56,14 @@ public function unsubscribe(Channel $channel, Connection $connection): void unset($this->connections[$this->application->id()][$channel->name()][$connection->id()]); } + /** + * Unsubscribe from a channel. + */ + public function unsub(string $channel, Connection $connection): void + { + unset($this->connections[$this->application->id()][$channel][$connection->id()]); + } + /** * Get all the channels. */ @@ -72,7 +80,7 @@ public function all(): Collection public function unsubscribeFromAll(Connection $connection): void { $this->channels()->each(function ($connections, $name) use ($connection) { - ChannelBroker::create($name)->unsubscribe($connection); + $this->unsub($name, $connection); }); }