momostafa
momostafa
FFilament
Created by momostafa on 7/14/2024 in #❓┊help
How to save Reverb Broadcasted notifications to database?
Hi, I am using Reverb Broadcast and below code sends and displays broadcasted notification properly on the frontend but it is not saved on default notification database for later viewing like when using notification database method. how to save notifications to database when using broadcast method?
$title = $data['title'];
$message = $data['message'];
$user = auth()->user();
$url = $data['url'];

$user->notify(
Notification::make()
->success()
->title($title)
->body($message)
->persistent()
->actions([
Action::make('View')
->button()
->url($url),
])
->toBroadcast(),
);
$title = $data['title'];
$message = $data['message'];
$user = auth()->user();
$url = $data['url'];

$user->notify(
Notification::make()
->success()
->title($title)
->body($message)
->persistent()
->actions([
Action::make('View')
->button()
->url($url),
])
->toBroadcast(),
);
Thanks for your help and support
4 replies