是否可以通过推送器使用 Laravel 通知来通知所有用户?

is it possible to notify all users using Laravel notification with pusher?

是否可以在有新公告时create/send通知所有用户。

我希望使用数据库通知通知所有用户。

由于我看到的大部分教程都是邮件通知,请问这样可以吗?请附上链接或关于我如何实现它的任何想法。

Literally in the documentation:

Alternatively, you may send notifications via the Notification facade. This is useful primarily when you need to send a notification to multiple notifiable entities such as a collection of users. To send notifications using the facade, pass all of the notifiable entities and the notification instance to the send method:

Notification::send($users, new InvoicePaid($invoice));

所以是的,您可以通过从数据库中获取所有用户并使用外观发送通知来发送给所有用户。

例如:

Notification::send(User::all(), new InvoicePaid($invoice));