diff --git a/src/Connection.php b/src/Connection.php index 8cf9c176..2ca5e3d0 100644 --- a/src/Connection.php +++ b/src/Connection.php @@ -4,6 +4,7 @@ use Laravel\Reverb\Concerns\GeneratesIdentifiers; use Laravel\Reverb\Contracts\Connection as ConnectionContract; +use Laravel\Reverb\Events\ConnectionTerminated; use Laravel\Reverb\Events\MessageSent; class Connection extends ConnectionContract @@ -56,5 +57,7 @@ public function send(string $message): void public function terminate(): void { $this->connection->close(); + + ConnectionTerminated::dispatch($this); } } diff --git a/src/Events/ConnectionTerminated.php b/src/Events/ConnectionTerminated.php new file mode 100644 index 00000000..f5baae60 --- /dev/null +++ b/src/Events/ConnectionTerminated.php @@ -0,0 +1,19 @@ +