移除 冗余
This commit is contained in:
parent
0ad8e5118d
commit
a0bd776aa6
@ -36,7 +36,7 @@ public function __construct(User|int $user, $event, array|Model $data)
|
|||||||
|
|
||||||
// if user is int
|
// if user is int
|
||||||
if (is_int($user)) {
|
if (is_int($user)) {
|
||||||
$user = User::find($user);
|
$user = (new User)->find($user);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->user = $user;
|
$this->user = $user;
|
||||||
|
@ -142,7 +142,7 @@ public function safeDelete(): bool
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function routeNotificationForMail(WorkOrderNotification $work_order): array
|
public function routeNotificationForMail(): array
|
||||||
{
|
{
|
||||||
$user = $this->user;
|
$user = $this->user;
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ public function send(mixed $notifiable, Notification $notification): void
|
|||||||
|
|
||||||
$user_id = $notifiable->user_id ?? $notifiable->id;
|
$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));
|
broadcast(new Users($user, $data['event'], $data));
|
||||||
}
|
}
|
||||||
|
@ -25,11 +25,10 @@ public function __construct()
|
|||||||
/**
|
/**
|
||||||
* Get the notification's delivery channels.
|
* Get the notification's delivery channels.
|
||||||
*
|
*
|
||||||
* @param Balance $notifiable
|
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function via(Balance $notifiable): array
|
public function via(): array
|
||||||
{
|
{
|
||||||
return [WeComChannel::class];
|
return [WeComChannel::class];
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,7 @@ public function __construct(array|Model $message, string $event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->message = $message;
|
$this->message = $message;
|
||||||
|
$this->event = $event;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user