Search by

defstudio / filament-sidebar-poll

fabio.ivona

A polling setting to regularly update your Filament sidebar

Package info

github.com/defstudio/filament-sidebar-poll

pkg:composer/defstudio/filament-sidebar-poll

Fund package maintenance!

defstudio

Statistics

Installs: 23

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.1 2026-11-02 16:37 UTC

This package is auto-updated.

Last update: 2026-11-02 16:43:03 UTC


README

Latest Version on Packagist Tests

Automatically refresh your Filament sidebar so navigation badges and other dynamic navigation content stay up to date. Uses Filament's existing Livewire sidebar, with a default polling interval of 10 seconds.

Requirements

  • PHP 8.2 or later
  • Filament 5
  • Laravel 11, 12, or 13 (Laravel 13 requires PHP 8.3 or later)

Installation

composer require defstudio/filament-sidebar-poll

Register the plugin in each panel that should poll:

use DefStudio\FilamentSidebarPoll\SidebarPoll;
use Filament\Panel;

public function panel(Panel $panel): Panel
{
    return $panel
        // Your existing panel configuration...
        ->plugin(SidebarPoll::make());
}

No migrations, assets, custom theme, or build steps are required.

Configuration

Override the interval for an individual panel:

SidebarPoll::make()->pollingInterval('30s')

Intervals must be positive integers followed by ms, s, or m, for example 500ms, 30s, or 1m. Invalid intervals throw an InvalidArgumentException.

To change the default for all panels, publish the configuration:

php artisan vendor:publish --tag="filament-sidebar-poll-config"

This creates config/sidebar-poll.php:

return [
    'interval' => '10s',
];

Per-panel settings take precedence over the configuration file. After changing configuration in production, rebuild your application's configuration cache.

Optionally publish the view:

php artisan vendor:publish --tag="filament-sidebar-poll-views"

Production considerations

Each open sidebar makes approximately one request per interval. Prefer longer intervals when navigation badge queries are expensive or many users are connected. Livewire automatically reduces polling in background tabs; this plugin preserves that behavior. See the Livewire polling documentation.

Use closures for dynamic navigation values so they are recalculated when the sidebar renders. Values cached by your application retain that cache's lifetime.

Polling applies to the sidebar. Panels using top navigation do not have a sidebar to refresh.

Development

composer install
composer test
composer analyse
composer test:lint

The integration tests render Filament's real sidebar and call its Livewire refresh action, including a changing navigation badge. Browser timers and production load require validation in the consuming application.

Changelog

See CHANGELOG.

Contributing

See CONTRIBUTING.

Security

See our security policy.

Credits

License

MIT. See LICENSE.