From ece40a34b82e719ddba3290d0aa0c6becaa63a4e Mon Sep 17 00:00:00 2001 From: singularity43 <46550600+singularity43@users.noreply.github.com> Date: Sat, 9 Feb 2019 14:56:10 -0500 Subject: [PATCH] (Add) Chatter Event For private channel. --- app/Events/Chatter.php | 74 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 app/Events/Chatter.php diff --git a/app/Events/Chatter.php b/app/Events/Chatter.php new file mode 100644 index 000000000..b22a6ca5b --- /dev/null +++ b/app/Events/Chatter.php @@ -0,0 +1,74 @@ +type = $type; + if($type == 'echo') { + $this->echoes = $payload; + } else if($type == 'audible') { + $this->audibles = $payload; + } else if($type == 'new.message') { + $this->message = $payload; + } else if($type == 'new.bot') { + $this->message = $payload; + } else if($type == 'new.ping') { + $this->ping = $payload; + } + $this->target = $target; + } + + /** + * Get the channels the event should broadcast on. + * + * @return Channel|array + */ + public function broadcastOn() + { + // $this->dontBroadcastToCurrentUser(); + + return new PrivateChannel('chatter.'.$this->target); + } + +} \ No newline at end of file