ReceivingEvent.php 701 B

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