Lae/app/Events/ServerEvent.php

30 lines
503 B
PHP
Raw Normal View History

2022-09-22 06:00:03 +00:00
<?php
namespace App\Events;
use Illuminate\Broadcasting\Channel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
class ServerEvent extends Event implements ShouldBroadcast
{
2022-09-22 12:07:38 +00:00
public array $data;
2022-09-22 06:00:03 +00:00
public string $type = 'servers.updated';
public function __construct($servers)
{
2022-09-22 12:07:38 +00:00
$this->data = $servers;
2022-09-22 06:00:03 +00:00
}
public function broadcastOn()
{
return new Channel('servers');
}
public function broadcastAs()
{
return 'servers';
}
}