From 3481dc75fcf07f994d724dc88d0f5fa8a3c295b5 Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Wed, 21 Aug 2019 11:11:44 +0800 Subject: [PATCH] Allow to pass single user to send notifications at hook --- app/Services/Hook.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Services/Hook.php b/app/Services/Hook.php index d4d4649b..2b309515 100644 --- a/app/Services/Hook.php +++ b/app/Services/Hook.php @@ -9,6 +9,7 @@ use Closure; use App\Events; use Notification; use App\Notifications; +use Illuminate\Support\Arr; use Illuminate\Support\Str; class Hook @@ -131,7 +132,7 @@ class Hook public static function sendNotification($users, string $title, $content = ''): void { - Notification::send($users, new Notifications\SiteMessage($title, $content)); + Notification::send(Arr::wrap($users), new Notifications\SiteMessage($title, $content)); } public static function pushMiddleware($middleware)