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.
Solution:
I have created a new project Filament, and it works fine. Thank you for helping me out. and the notifications works fine
Jump to solution
18 Replies
BBB
BBB2mo ago
Hi... Queue is running ?
Dennis Koch
Dennis Koch2mo ago
The notification is being sent, but the data isn't being saved.
What do you mean by "data isn't being saved"? Which data?
->sendToDatabase(User::all());
This sends the notification to all you users.
Yacoub Al-haidari
Would you please see the video record for the problem?
i am using livewire 3.4 and filament 3.2.71 and laravel 11
Dennis Koch
Dennis Koch2mo ago
- Is your queue running? As BBB pointed out? - Is Admin the same model you use as user model for the panel? - What does the notifications table look like in your DB?
Yacoub Al-haidari
1-No, it is not running . 2- Yes,it is
No description
Yacoub Al-haidari
no , as you can see the video i sent message but the the notification isn't saving the data
Dennis Koch
Dennis Koch2mo ago
1. So did you try starting the queue worker? 3. So no notifications?Ah I see "total 0"
Yacoub Al-haidari
i made php artisan queue:work or php artisan queue:listen . I got the notification but the notification table is null
No description
No description
Dennis Koch
Dennis Koch2mo ago
But now you have 1 notification?
Yacoub Al-haidari
Yes , but the notification table is null
Dennis Koch
Dennis Koch2mo ago
That's weird. Are you sure that's the right DB etc? But the problem "no notifications" is fixed, right?
Yacoub Al-haidari
i am sure , iam using the right database .
Yes.it is the notifications" not fixed
رجل الجمبري
I'm having the same issue. Notifications not saving the the database table. My laravel project has been upgraded to laravel 10. Filament and livewire upgraded from 2 to 3 looks like my queue driver was set to database but i didn't have a worker running. after changing to sync it inserted the notification into the table.
Solution
Yacoub Al-haidari
I have created a new project Filament, and it works fine. Thank you for helping me out. and the notifications works fine