改进 模块广播
This commit is contained in:
parent
6ccefe2096
commit
9128630923
@ -15,7 +15,7 @@ class Users extends Event implements ShouldBroadcastNow
|
|||||||
|
|
||||||
public User $user;
|
public User $user;
|
||||||
public string $type = 'ping';
|
public string $type = 'ping';
|
||||||
public string|array $message;
|
public string|array $data;
|
||||||
public null|Module $module;
|
public null|Module $module;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -27,7 +27,7 @@ public function __construct(User $user, $type, $message)
|
|||||||
{
|
{
|
||||||
$this->user = $user;
|
$this->user = $user;
|
||||||
$this->type = $type;
|
$this->type = $type;
|
||||||
$this->message = $message;
|
$this->data = $message;
|
||||||
|
|
||||||
if (Auth::guard('module')->check()) {
|
if (Auth::guard('module')->check()) {
|
||||||
$this->module = Auth::guard('module')->user();
|
$this->module = Auth::guard('module')->user();
|
||||||
|
@ -10,12 +10,10 @@
|
|||||||
return (int)$user->id === (int)$userId;
|
return (int)$user->id === (int)$userId;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
Broadcast::channel('work-orders.{uuid}', function () {
|
Broadcast::channel('work-orders.{uuid}', function () {
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
Broadcast::channel('servers', function () {
|
Broadcast::channel('servers', function () {
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user