| 1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- namespace App\Events;
- use Illuminate\Broadcasting\Channel;
- use Illuminate\Broadcasting\PresenceChannel;
- use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
- class BroadcastToStation implements ShouldBroadcast
- {
- public $json;
- private $id;
- /**
- * Create a new event instance.
- *
- * @param int $id
- * @param string $json
- * @return void
- */
- public function __construct(int $id, string $json)
- {
- $this->id = $id;
- $this->json = $json;
- }
- /**
- * Get the channels the event should broadcast on.
- *
- * @return Channel|array
- */
- public function broadcastOn()
- {
- return new Channel('station-'.$this->id);
- }
- }
|