ThreadCreated.php 799 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace App\Events;
  3. use Illuminate\Broadcasting\Channel;
  4. use Illuminate\Queue\SerializesModels;
  5. use Illuminate\Broadcasting\PrivateChannel;
  6. use Illuminate\Broadcasting\PresenceChannel;
  7. use Illuminate\Foundation\Events\Dispatchable;
  8. use Illuminate\Broadcasting\InteractsWithSockets;
  9. use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
  10. class ThreadCreated
  11. {
  12. use Dispatchable, InteractsWithSockets, SerializesModels;
  13. public $thread;
  14. /**
  15. * Create a new event instance.
  16. */
  17. public function __construct($thread)
  18. {
  19. $this->thread = $thread;
  20. }
  21. /**
  22. * Get the channels the event should broadcast on.
  23. *
  24. * @return Channel|array
  25. */
  26. public function broadcastOn()
  27. {
  28. return new PrivateChannel('channel-name');
  29. }
  30. }