PairSuccess.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. /**
  11. * 72小时活动匹配成功
  12. * Class PairSuccess
  13. * @package App\Events
  14. */
  15. class PairSuccess
  16. {
  17. use Dispatchable;
  18. use InteractsWithSockets;
  19. use SerializesModels;
  20. public $uid;
  21. public $pairUid;
  22. /**
  23. * Create a new event instance.
  24. *
  25. * @param int $uid 用户1
  26. * @param int $pairUid 匹配用户
  27. */
  28. public function __construct(int $uid, int $pairUid)
  29. {
  30. $this->uid = $uid;
  31. $this->pairUid = $pairUid;
  32. }
  33. /**
  34. * Get the channels the event should broadcast on.
  35. *
  36. * @return \Illuminate\Broadcasting\Channel|array
  37. */
  38. public function broadcastOn()
  39. {
  40. return new PrivateChannel('channel-name');
  41. }
  42. }