henryonsoftware/filament-panel-switcher

A Filament plugin to switch between panels in the topbar.

Maintainers

Package info

github.com/henryonsoftware/filament-panel-switcher

pkg:composer/henryonsoftware/filament-panel-switcher

Transparency log

Statistics

Installs: 18

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.6.6 2026-05-22 15:44 UTC

This package is auto-updated.

Last update: 2026-07-22 16:18:43 UTC


README

A Filament plugin that adds a panel navigation switcher to the topbar, letting users move between multiple Filament panels without leaving the admin UI.

  • Desktop: horizontal tab-style links after the brand logo
  • Mobile: a dropdown triggered by the active panel's icon

Requirements

  • PHP 8.3+
  • Filament 4.x
  • Laravel 12.x

Installation

composer require henryonsoftware/filament-panel-switcher

Publish the config file:

php artisan vendor:publish --tag=filament-panel-switcher-config

Usage

  1. Register the plugin in each panel provider where the switcher should appear:
use HenryOnSoftware\FilamentPanelSwitcher\FilamentPanelSwitcherPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->plugin(FilamentPanelSwitcherPlugin::make());
}
  1. Add your panels to config/filament-panel-switcher.php:
return [
    'panels' => [
        'admin' => [
            'label' => 'Admin',
            'icon'  => 'heroicon-o-cog-8-tooth',
        ],
        'app' => [
            'label' => 'App',
            'icon'  => 'heroicon-o-home',
        ],
    ],
];

Keys are your panel IDs (set via ->id('...') in the panel provider). Both label and icon are optional — the label defaults to the title-cased panel ID, and the icon is omitted if not set.

  1. Add an import to your theme CSS file:
@import '../../../../vendor/henryonsoftware/filament-panel-switcher/resources/css/panel-switcher.css';

This will help compile the plugin CSS file to your theme.

Note: if you never create a theme before, please look at this

Custom Styling

If you want to custom the CSS file, first publish the CSS file:

This copies panel-switcher.css to resources/css/filament-panel-switcher.css.

php artisan vendor:publish --tag=filament-panel-switcher-css

and then replace the import above with new file path in your theme file

@import '../../../../resources/css/filament-panel-switcher.css';

Custom Views

Publish the views to override the markup:

php artisan vendor:publish --tag=filament-panel-switcher-views

This copies the templates to resources/views/vendor/filament-panel-switcher/.

Custom Config Key

If your project already stores panel metadata under a different config key, you can point the plugin at it instead of the default filament-panel-switcher.panels:

FilamentPanelSwitcherPlugin::make()->configKey('my-config.panels')

Access Control

The switcher respects each panel's built-in access control. It calls $user->canAccessPanel($panel) and only renders panels the authenticated user can access. Implement this method on your User model:

use Filament\Panel;

public function canAccessPanel(Panel $panel): bool
{
    return match ($panel->getId()) {
        'admin'  => $this->isAdmin(),
        default  => true,
    };
}

License

MIT