Installing database notifications on existing project
I'm trying to do that but I see that I don't have any assets published in my views directory and only javascript assets are published. I have checked in
vendor/filament/notifications/views
and there are still many assets that have not been published.
Also, in the documentation it mentions that the view must be registered in a Service Provider, but it doesn't mention in which one, I tried to do it in the AppServiceProvider
but it doesn't work because it shows the error "Undefined variable $unreadNotificationsCount
".
Someone please guide me :S14 Replies
This in Filament v3
you are trying to add notification not in a panel right?
Right
just checked the installation part in the docs and it doesn't mention anything about provider
Says: In the service provider, point to this new trigger view:
use Filament\Notifications\Livewire\DatabaseNotifications;
DatabaseNotifications::trigger('filament-notifications.database-notifications-trigger');
well first thing you shouldn't publish views
if I remember correctly just adding
@livewire('database-notifications')
should workIn the boot() method of your AppServiceProvider ...
This assumes you followed the instructions and created your trigger view in the correct place. And you don't need the pollingInterval, that's just what I happen to do.
When do it, show me this
View [filament-notifications.database-notifications-trigger] not found.
'filament-notifications.database-notifications-trigger' is an example. you have to actually create the view in your app
Why is it in livewire?
/resources/views/notifications/database-notifications-trigger.blade.php
Is not in Livewire foilder
Folder*
Now is working Guys!
🥳
Thank you so much!
The problem: my folder is "notifications" not "filament-Notifications" haha