You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
722 B

  1. <?php
  2. namespace App\Channels\Messages;
  3. class SocketMessage
  4. {
  5. /**
  6. * The devices token to send the message from.
  7. *
  8. * @var array|string
  9. */
  10. public $to;
  11. /**
  12. * The data of the Socket message.
  13. *
  14. * @var array
  15. */
  16. public $data;
  17. /**
  18. * Set the devices token to send the message from.
  19. *
  20. * @param array|string $to
  21. * @return $this
  22. */
  23. public function to($to)
  24. {
  25. $this->to = $to;
  26. return $this;
  27. }
  28. /**
  29. * Set the data of the socket message.
  30. *
  31. * @param array $data
  32. * @return $this
  33. */
  34. public function data(array $data)
  35. {
  36. $this->data = $data;
  37. return $this;
  38. }
  39. }