Allow to pass single user to send notifications at hook

This commit is contained in:
Pig Fang 2019-08-21 11:11:44 +08:00
parent cd9fa0b3d3
commit 3481dc75fc

View File

@ -9,6 +9,7 @@ use Closure;
use App\Events; use App\Events;
use Notification; use Notification;
use App\Notifications; use App\Notifications;
use Illuminate\Support\Arr;
use Illuminate\Support\Str; use Illuminate\Support\Str;
class Hook class Hook
@ -131,7 +132,7 @@ class Hook
public static function sendNotification($users, string $title, $content = ''): void 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) public static function pushMiddleware($middleware)