Database Notification using jobs not showing
Hi, i'm sending a database notification inside a job, but it only shows on the "notification bell" without reloading the page (that is correct) but not as the usual popup notification message. The code used inside the job is this:
$recipient = $this->user;
Notification::make()
->title('Saved successfully')
->send()
->sendToDatabase($recipient);
If I try on local with sync queue it works as expected, showing both the popup and the message inside the notification bell, but if I use an async enviroment like database queue, the popup never shows up.
2 Replies
when using database as your sync queue, you must run the following command in the background:
php artisan queue:work
I think database notifications don’t pop up