DatabaseNotificationsSent::dispatch($recipient); I also tried this first per the docs, but they should be equivalent event(new DatabaseNotificationsSent($recipient));'broadcasting' => [
'echo' => [
'broadcaster' => 'pusher',
'key' => env('VITE_PUSHER_APP_KEY'),
'cluster' => env('VITE_PUSHER_APP_CLUSTER'),
'forceTLS' => true,
],
],
import Echo from 'laravel-echo';
import Pusher from 'pusher-js';
window.Pusher = Pusher;
window.Echo = new Echo({
broadcaster: 'pusher',
key: import.meta.env.VITE_PUSHER_APP_KEY,
cluster: import.meta.env.VITE_PUSHER_CLUSTER,
forceTLS: true
});
const userId = window.userId;
window.Echo.private(App.Models.User.${userId})
.listen('.database-notifications.sent', (e) => {
console.log("Event received:", e);
});