SendGoodLogEvent.php 782 B

123456789101112131415161718192021222324252627282930313233343536
  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 SendGoodLogEvent
  10. {
  11. use InteractsWithSockets, SerializesModels;
  12. /**
  13. * Create a new event instance.
  14. *
  15. * @return void
  16. */
  17. public $data;
  18. public function __construct($data)
  19. {
  20. $this->data=$data;
  21. }
  22. /**
  23. * Get the channels the event should broadcast on.
  24. *
  25. * @return \Illuminate\Broadcasting\Channel|array
  26. */
  27. public function broadcastOn()
  28. {
  29. return new PrivateChannel('channel-name');
  30. }
  31. }