diff --git a/app/Events/NewMention.php b/app/Events/NewMention.php new file mode 100644 index 000000000..90adcc0d8 --- /dev/null +++ b/app/Events/NewMention.php @@ -0,0 +1,51 @@ +user = $user; + $this->data = $data; + } + + public function broadcastAs() + { + return 'notification.new.mention'; + } + + public function broadcastOn() + { + return new PrivateChannel('App.User.' . $this->user->id); + } + + public function broadcastWith() + { + return ['id' => $this->user->id]; + } + + public function via() + { + return 'broadcast'; + } +} diff --git a/app/Events/Notification/NewPublicPost.php b/app/Events/Notification/NewPublicPost.php new file mode 100644 index 000000000..e43b1f19b --- /dev/null +++ b/app/Events/Notification/NewPublicPost.php @@ -0,0 +1,57 @@ +status = $status; + } + + public function broadcastAs() + { + return 'status'; + } + + public function broadcastOn() + { + return new Channel('firehost.public'); + } + + public function broadcastWith() + { + $resource = new Fractal\Resource\Item($this->status, new StatusTransformer()); + $res = $this->fractal->createData($resource)->toArray(); + return [ + 'entity' => $res + ]; + } + + public function via() + { + return 'broadcast'; + } +}