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
50 lines
722 B
<?php
|
|
|
|
|
|
namespace App\Channels\Messages;
|
|
|
|
|
|
class SocketMessage
|
|
{
|
|
/**
|
|
* The devices token to send the message from.
|
|
*
|
|
* @var array|string
|
|
*/
|
|
public $to;
|
|
|
|
/**
|
|
* The data of the Socket message.
|
|
*
|
|
* @var array
|
|
*/
|
|
public $data;
|
|
|
|
|
|
/**
|
|
* Set the devices token to send the message from.
|
|
*
|
|
* @param array|string $to
|
|
* @return $this
|
|
*/
|
|
public function to($to)
|
|
{
|
|
$this->to = $to;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Set the data of the socket message.
|
|
*
|
|
* @param array $data
|
|
* @return $this
|
|
*/
|
|
public function data(array $data)
|
|
{
|
|
$this->data = $data;
|
|
|
|
return $this;
|
|
}
|
|
|
|
}
|