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>


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
    {

    }
}


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
Was this page helpful?