CompleteInfoRemind.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace App\Events;
  3. use App\Models\User\UserModel;
  4. use Illuminate\Queue\SerializesModels;
  5. use Illuminate\Broadcasting\PrivateChannel;
  6. use Illuminate\Foundation\Events\Dispatchable;
  7. use Illuminate\Broadcasting\InteractsWithSockets;
  8. /**
  9. * 提醒补全信息
  10. * Class CompleteInfoRemind
  11. * @package App\Events
  12. */
  13. class CompleteInfoRemind
  14. {
  15. use Dispatchable;
  16. use InteractsWithSockets;
  17. use SerializesModels;
  18. /** @var UserModel 被提醒用户 */
  19. public $is_remind_user;
  20. public $remind_nickname;
  21. /**
  22. * Create a new event instance.
  23. *
  24. * @param UserModel $is_remind_user
  25. * @param string $remind_nickname
  26. */
  27. public function __construct(UserModel $is_remind_user, string $remind_nickname)
  28. {
  29. $this->is_remind_user = $is_remind_user;
  30. $this->remind_nickname = $remind_nickname;
  31. }
  32. /**
  33. * Get the channels the event should broadcast on.
  34. *
  35. * @return \Illuminate\Broadcasting\Channel|array
  36. */
  37. public function broadcastOn()
  38. {
  39. return new PrivateChannel('channel-name');
  40. }
  41. }