diff --git a/app/Events/Users.php b/app/Events/Users.php index 87bc047..eda25b6 100644 --- a/app/Events/Users.php +++ b/app/Events/Users.php @@ -36,7 +36,7 @@ public function __construct(User|int $user, $event, array|Model $data) // if user is int if (is_int($user)) { - $user = User::find($user); + $user = (new User)->find($user); } $this->user = $user; diff --git a/app/Models/WorkOrder/WorkOrder.php b/app/Models/WorkOrder/WorkOrder.php index e232051..d49effe 100644 --- a/app/Models/WorkOrder/WorkOrder.php +++ b/app/Models/WorkOrder/WorkOrder.php @@ -142,7 +142,7 @@ public function safeDelete(): bool return true; } - public function routeNotificationForMail(WorkOrderNotification $work_order): array + public function routeNotificationForMail(): array { $user = $this->user; diff --git a/app/Notifications/Channels/WebChannel.php b/app/Notifications/Channels/WebChannel.php index 9a17821..7ee8a46 100644 --- a/app/Notifications/Channels/WebChannel.php +++ b/app/Notifications/Channels/WebChannel.php @@ -29,7 +29,7 @@ public function send(mixed $notifiable, Notification $notification): void $user_id = $notifiable->user_id ?? $notifiable->id; - $user = User::find($user_id); + $user = (new User)->find($user_id); broadcast(new Users($user, $data['event'], $data)); } diff --git a/app/Notifications/User/UserCharged.php b/app/Notifications/User/UserCharged.php index 0d4d037..a325d7c 100644 --- a/app/Notifications/User/UserCharged.php +++ b/app/Notifications/User/UserCharged.php @@ -25,11 +25,10 @@ public function __construct() /** * Get the notification's delivery channels. * - * @param Balance $notifiable * * @return array */ - public function via(Balance $notifiable): array + public function via(): array { return [WeComChannel::class]; } diff --git a/app/Notifications/WebNotification.php b/app/Notifications/WebNotification.php index e9514c5..33ab230 100644 --- a/app/Notifications/WebNotification.php +++ b/app/Notifications/WebNotification.php @@ -26,6 +26,7 @@ public function __construct(array|Model $message, string $event) } $this->message = $message; + $this->event = $event; } /**