Search by

jeffersongoncalves / filament-centrifugo

jeffersongoncalves

Realtime Filament notifications over Centrifugo websockets: injects a Laravel Echo stand-in into the panel and turns off database-notification polling.

3.0.1 2026-11-08 21:46 UTC

This package is auto-updated.

Last update: 2026-11-08 21:47:27 UTC


README

Filament Centrifugo

Filament Centrifugo

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads License

Realtime Filament notifications over Centrifugo websockets, built on jeffersongoncalves/laravel-centrifugo. The plugin:

  • injects a Laravel Echo stand-in into the panel for logged-in users — Filament's database and broadcast notifications arrive over the websocket, no Pusher protocol, no npm build;
  • connects as the panel's auth guard (an admin panel connects as the admin, even with a web user logged in on the same browser);
  • turns database-notification polling off, and refreshes the bell live for every stored Filament notification — sendToDatabase() works with or without isEventDispatched: true.

Compatibility

Package Version Filament Version
1.x 3.x
2.x 4.x
3.x 5.x

Requires Laravel 12 or 13 (from laravel-centrifugo).

Installation

You can install the package via composer:

composer require jeffersongoncalves/filament-centrifugo

Configure Centrifugo and the .env as described in laravel-centrifugo:

BROADCAST_CONNECTION=centrifugo
CENTRIFUGO_API_URL=http://127.0.0.1:8000/api
CENTRIFUGO_API_KEY=<API_KEY>
CENTRIFUGO_TOKEN_HMAC_SECRET=<SECRET>
CENTRIFUGO_URL=https://ws.your-app.com

Usage

Register the plugin in your panel:

use JeffersonGoncalves\Filament\Centrifugo\CentrifugoPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->authGuard('admin')
        ->databaseNotifications()
        ->plugin(CentrifugoPlugin::make());
}

Enable Laravel's broadcasting auth route and authorize the notification channel on the panel's guard:

// bootstrap/app.php
->withBroadcasting(__DIR__.'/../routes/channels.php')

// routes/channels.php
Broadcast::channel(
    'App.Models.Admin.{id}',
    fn ($admin, $id) => (string) $admin->id === $id,
    ['guards' => ['admin']],
);

Send notifications as usual — the bell refreshes live:

Notification::make()
    ->title('Export finished')
    ->sendToDatabase($admin);

// or a toast pushed straight to the open panel
Notification::make()->title('Saved')->broadcast($admin);

Broadcast events are queued — run a queue worker.

Keep polling

CentrifugoPlugin::make()->disablePolling(false)

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.