Laravel 11 Filament 3 database notification Not save Data
I'm using Livewire on the frontend page. When a client sends an email via the contact us form, I want to receive a notification. Here's the code I'm using
public function SendEmailVia()
{
code......
and
Notification::make()
->title('You have a new message
')
->success()
->body('Requester: ' . $this->name)
->actions([
Action::make('markAsRead')
->label('Mark as Read')
->button()
->markAsRead(),
])
->sendToDatabase(User::all());
}
However, the notification isn't saving the data, and no errors are appearing. The notification is being sent, but the data isn't being saved.
public function SendEmailVia()
{
code......
and
Notification::make()
->title('You have a new message
->success()
->body('Requester: ' . $this->name)
->actions([
Action::make('markAsRead')
->label('Mark as Read')
->button()
->markAsRead(),
])
->sendToDatabase(User::all());
}
However, the notification isn't saving the data, and no errors are appearing. The notification is being sent, but the data isn't being saved.
Solution
I have created a new project Filament, and it works fine. Thank you for helping me out. and the notifications works fine