|
@@ -0,0 +1,36 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace App\Events;
|
|
|
+
|
|
|
+use Illuminate\Broadcasting\Channel;
|
|
|
+use Illuminate\Queue\SerializesModels;
|
|
|
+use Illuminate\Broadcasting\PrivateChannel;
|
|
|
+use Illuminate\Broadcasting\PresenceChannel;
|
|
|
+use Illuminate\Foundation\Events\Dispatchable;
|
|
|
+use Illuminate\Broadcasting\InteractsWithSockets;
|
|
|
+use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
|
|
|
+
|
|
|
+class ThreadCreated
|
|
|
+{
|
|
|
+ use Dispatchable, InteractsWithSockets, SerializesModels;
|
|
|
+
|
|
|
+ public $thread;
|
|
|
+
|
|
|
+
|
|
|
+ * Create a new event instance.
|
|
|
+ */
|
|
|
+ public function __construct($thread)
|
|
|
+ {
|
|
|
+ $this->thread = $thread;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * Get the channels the event should broadcast on.
|
|
|
+ *
|
|
|
+ * @return Channel|array
|
|
|
+ */
|
|
|
+ public function broadcastOn()
|
|
|
+ {
|
|
|
+ return new PrivateChannel('channel-name');
|
|
|
+ }
|
|
|
+}
|