diff --git a/app/Events/Users.php b/app/Events/Users.php index c74471b..82e007f 100644 --- a/app/Events/Users.php +++ b/app/Events/Users.php @@ -52,9 +52,9 @@ public function __construct(User|int $user, string $event, array|Model $data) if (Auth::guard('module')->check()) { $this->module = Auth::guard('module')->user(); - if (isset($this->data['event'])) { - $this->event = $this->module->id . '.' . $this->data['event']; - } + // if (isset($this->data['event'])) { + // $this->event = $this->module->id . '.' . $this->data['event']; + // } } diff --git a/app/Notifications/WebNotification.php b/app/Notifications/WebNotification.php index d84ccae..0073691 100644 --- a/app/Notifications/WebNotification.php +++ b/app/Notifications/WebNotification.php @@ -17,13 +17,15 @@ class WebNotification extends Notification * * @return void */ - public function __construct(array|Model $message) + public function __construct(array|Model $message, string $event = 'notification') { if ($message instanceof Model) { - $message = $message->toArray(); + $this->message = $message->toArray(); + } else { + $this->message = $message; } - $this->message = $message; + $this->message['event'] = $event; } /**