© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
1 reply
Jakub

What does register in service provider mean?

Is this something only for fillament panels?

I am trying to get the notification count working

// views/components/trigger
<button x-data="{}" class="text-white" x-on:click="$dispatch('open-modal', { id: 'database-notifications' })"
    type="button">
    Notifications ( {{ $unreadNotificationsCount }} unread)
</button>
// views/components/trigger
<button x-data="{}" class="text-white" x-on:click="$dispatch('open-modal', { id: 'database-notifications' })"
    type="button">
    Notifications ( {{ $unreadNotificationsCount }} unread)
</button>


AppServiceProvider.php
<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Filament\Notifications\Livewire\DatabaseNotifications;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     */
    public function register(): void
    {
        DatabaseNotifications::trigger('components.trigger');
    }

    /**
     * Bootstrap any application services.
     */
    public function boot(): void
    {

    }
}
<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Filament\Notifications\Livewire\DatabaseNotifications;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     */
    public function register(): void
    {
        DatabaseNotifications::trigger('components.trigger');
    }

    /**
     * Bootstrap any application services.
     */
    public function boot(): void
    {

    }
}


I got things working for the most part, as I am able to click the trigger, and the modal opens and i see the notifications. Just trynig to make the count part work.

Trying to make this work in a livewire app that i just installed fillament onto. Not a fresh fillament app.
d5c1e24251f186c80f5240f42cfbb51a.png
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Register plugin from service provider
FilamentFFilament / ❓┊help
14mo ago
What does this error mean?
FilamentFFilament / ❓┊help
9mo ago
How to register panel provider in plugin
FilamentFFilament / ❓┊help
11mo ago
What does the `->default()` method do on the panel service provider?
FilamentFFilament / ❓┊help
3y ago