Database Notifications trigger button not rendered

I'm following the instructions to set up database notifications. I added the blade to my layout file:

<body class="antialiased">
    @livewire('notifications')
    @livewire('database-notifications')

    {{ $slot ?? '' }}
    @yield('content')


    @filamentScripts
    @vite('resources/js/app.js')
</body>


I added this to a new blade file in resources/views/notifications/database-notifications-trigger.blade.php:

<button type="button">
    Notifications ({{ $unreadNotificationsCount }} unread)
</button>


I added this to the boot method of my AppServiceProvider:
 DatabaseNotifications::trigger('notifications.database-notifications-trigger');


The trigger button isn't rendered in my view.
Solution
ok, apparently you also have to add some lines to the panel provider, which I didn't see in the docs.

            ->databaseNotifications()
            ->databaseNotificationsPolling('30s');
Was this page helpful?