30 lines
503 B
PHP
30 lines
503 B
PHP
<?php
|
|
|
|
namespace App\Events;
|
|
|
|
use Illuminate\Broadcasting\Channel;
|
|
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
|
|
|
|
class ServerEvent extends Event implements ShouldBroadcast
|
|
{
|
|
|
|
public array $data;
|
|
|
|
public string $type = 'servers.updated';
|
|
|
|
public function __construct($servers)
|
|
{
|
|
$this->data = $servers;
|
|
}
|
|
|
|
public function broadcastOn()
|
|
{
|
|
return new Channel('servers');
|
|
}
|
|
|
|
public function broadcastAs()
|
|
{
|
|
return 'servers';
|
|
}
|
|
}
|