From adcd300a941b7d3bcd0a4119146cb201491a2b7e Mon Sep 17 00:00:00 2001 From: freek Date: Mon, 26 Nov 2018 09:22:30 +0100 Subject: [PATCH] use event --- src/Dashboard/EventHandler.php | 8 ++++++++ src/Events/ChannelVacated.php | 4 ++-- src/LaravelEcho/Pusher/Channels/Channel.php | 2 ++ 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 src/Dashboard/EventHandler.php diff --git a/src/Dashboard/EventHandler.php b/src/Dashboard/EventHandler.php new file mode 100644 index 0000000..460b2b6 --- /dev/null +++ b/src/Dashboard/EventHandler.php @@ -0,0 +1,8 @@ +subscriptions[$connection->socketId]); if (! $this->hasConnections()) { + event(new ChannelVacated($connection, $this->channelId)); Dashboard::vacated($connection, $this->channelId); } }