You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been trying for a couple of hours now to send push messages to guests of our website, but no matter what I do it seems to run afoul of the way Laravel wants to work - that being, using some sort of Notifiable class, such as User.
Anyone have suggestions as to how to make this work?
The text was updated successfully, but these errors were encountered:
Simple, create a class with any name (i.e. Guests) in the App Dir, as below.
<?php
namespace App;
use Illuminate\Notifications\Notifiable;
class Guests{
use Notifiable;
public function routeNotificationForPusherPushNotifications() : string{
return 'guests_users';
}
}
And then in your controller, repo etc. send the notification as: Notification::send(new Guests(), new NewInvoice($invoice));
On the client side subscribe your users/devices to the guests_users interest.
That works, but what if you want to send also a email?
$users = User::all();
Notification::send($users, new NewVersionRelease($release));
Let's say you want pusher to send it via the "guest" interest, but for mail it needs to send to each individual email address,
also, if the routeNotificationForPusherPushNotifications() return guests_users it will create one push notification for each user to the same interests. i will fail.
I've been trying for a couple of hours now to send push messages to guests of our website, but no matter what I do it seems to run afoul of the way Laravel wants to work - that being, using some sort of Notifiable class, such as User.
Anyone have suggestions as to how to make this work?
The text was updated successfully, but these errors were encountered: