UnEachLike.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. * 取消相互心动事件
  12. * Class UnEachLike
  13. * @package App\Events
  14. */
  15. class UnEachLike
  16. {
  17. use Dispatchable;
  18. use InteractsWithSockets;
  19. use SerializesModels;
  20. public $uid;
  21. public $unLikeUid;
  22. /**
  23. * Create a new event instance.
  24. *
  25. * @param int $uid
  26. * @param int $unLikeUid
  27. */
  28. public function __construct(int $uid, int $unLikeUid)
  29. {
  30. $this->uid = $uid;
  31. $this->unLikeUid = $unLikeUid;
  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. }