改进 模块广播

This commit is contained in:
iVampireSP.com 2023-01-11 00:14:32 +08:00
parent 6ccefe2096
commit 9128630923
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132
2 changed files with 2 additions and 4 deletions

View File

@ -15,7 +15,7 @@ class Users extends Event implements ShouldBroadcastNow
public User $user;
public string $type = 'ping';
public string|array $message;
public string|array $data;
public null|Module $module;
/**
@ -27,7 +27,7 @@ public function __construct(User $user, $type, $message)
{
$this->user = $user;
$this->type = $type;
$this->message = $message;
$this->data = $message;
if (Auth::guard('module')->check()) {
$this->module = Auth::guard('module')->user();

View File

@ -10,12 +10,10 @@
return (int)$user->id === (int)$userId;
});
Broadcast::channel('work-orders.{uuid}', function () {
return true;
});
Broadcast::channel('servers', function () {
return true;
});