| @@ 9-39 (lines=31) @@ | ||
| 6 | use Illuminate\Queue\SerializesModels; |
|
| 7 | use Ratchet\ConnectionInterface; |
|
| 8 | ||
| 9 | class Subscribed |
|
| 10 | { |
|
| 11 | use Dispatchable, SerializesModels; |
|
| 12 | ||
| 13 | /** |
|
| 14 | * The channel name the user has subscribed to. |
|
| 15 | * |
|
| 16 | * @var string |
|
| 17 | */ |
|
| 18 | protected $channelName; |
|
| 19 | ||
| 20 | /** |
|
| 21 | * The connection that initiated the subscription. |
|
| 22 | * |
|
| 23 | * @var \Ratchet\ConnectionInterface |
|
| 24 | */ |
|
| 25 | protected $connection; |
|
| 26 | ||
| 27 | /** |
|
| 28 | * Initialize the event. |
|
| 29 | * |
|
| 30 | * @param string $channelName |
|
| 31 | * @param \Ratchet\ConnectionInterface $connection |
|
| 32 | * @return void |
|
| 33 | */ |
|
| 34 | public function __construct(string $channelName, ConnectionInterface $connection) |
|
| 35 | { |
|
| 36 | $this->channelName = $channelName; |
|
| 37 | $this->connection = $connection; |
|
| 38 | } |
|
| 39 | } |
|
| 40 | ||
| @@ 9-39 (lines=31) @@ | ||
| 6 | use Illuminate\Queue\SerializesModels; |
|
| 7 | use Ratchet\ConnectionInterface; |
|
| 8 | ||
| 9 | class Unsubscribed |
|
| 10 | { |
|
| 11 | use Dispatchable, SerializesModels; |
|
| 12 | ||
| 13 | /** |
|
| 14 | * The channel name the user has unsubscribed from. |
|
| 15 | * |
|
| 16 | * @var string |
|
| 17 | */ |
|
| 18 | protected $channelName; |
|
| 19 | ||
| 20 | /** |
|
| 21 | * The connection that initiated the unsubscription. |
|
| 22 | * |
|
| 23 | * @var \Ratchet\ConnectionInterface |
|
| 24 | */ |
|
| 25 | protected $connection; |
|
| 26 | ||
| 27 | /** |
|
| 28 | * Initialize the event. |
|
| 29 | * |
|
| 30 | * @param string $channelName |
|
| 31 | * @param \Ratchet\ConnectionInterface $connection |
|
| 32 | * @return void |
|
| 33 | */ |
|
| 34 | public function __construct(string $channelName, ConnectionInterface $connection) |
|
| 35 | { |
|
| 36 | $this->channelName = $channelName; |
|
| 37 | $this->connection = $connection; |
|
| 38 | } |
|
| 39 | } |
|
| 40 | ||