database notification
Can help me about databse notification please. I have a notifications table and add @livewire('database-notifications') to app.blade.php but it doesn't work
28 Replies
doesnt work means what exactly?
my code like this and it doesn't save data to database
what error message you get then?
it doesn't have any error
when I use send(), it's work normally but sendToDatabase doesn't work
does it even hit
aftercreate()
method?have you enabled databaseNotifications in the provider?
yes i have do it
so after creating record does it hit your method?
yes, i test send() then it run nomarlly
but sendToDatabase doesn't work
I dont know I must config anything else
check the docs maybe you missed something
->sendToDatabse
in version 3 is changed to ->toDatabase()
here is my real code as an example:
you are sending it in different way than he is
yes I have test that way but it doesn't work too
Just to Review:
- did you do
composer require filament/notifications:"^3.0-stable" -W
?
- and php artisan filament:install --scaffold --notifications
- and php artisan filament:install --notifications
?There aren't any errors?
yes i do everything
no dont have error, it just doesn't save it in database
The
notifications
table exists?of course
nd add @livewire('database-notifications') to app.blade.php but it doesn't workFrom your screenshots it looks like you are using the panel, so no need to to this
Did you follow the docs for the panel notifications? https://filamentphp.com/docs/3.x/panels/notifications
yes I do all the doc say
😢
Did you publish Filament view files?
How to publish this
If you haven't, don't
Thank you so much
i have impelemnt notification which is showing in resource pages but not in custom pages see the image below
did you follow all the steps here? https://filamentphp.com/docs/3.x/notifications/installation
@shissaaa I've encountered this issue and I have to create a Laravel notification class then I changed the via from mail to database and add or replace the toMail to toDatabase method and return a Filament Notification
For some unknown reason (either the issue is from the framework or in my setup) the code provided in the Notification docs doesn't work