Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Filament Panel Switcher Laravel Package

henryonsoftware/filament-panel-switcher

View on GitHub
Deep Wiki
Context7

Getting Started

henryonsoftware/filament-panel-switcher is a small Filament plugin that adds a panel-switcher UI (a menu/dropdown listing the panels a user can access) so multi-panel apps don't require users to know URLs.

Minimal setup:

composer require henryonsoftware/filament-panel-switcher

Register the plugin on each panel you want the switcher to appear on, typically in a panel provider:

use HenryOnSoftware\FilamentPanelSwitcher\PanelSwitcherPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugin(PanelSwitcherPlugin::make());
}

First places to look:

  1. The plugin class itself (src/PanelSwitcherPlugin.php) — it will expose the fluent configuration surface (->panels(), visibility callbacks, label/icon options depending on version).
  2. config/filament-panel-switcher.php if publishable (php artisan vendor:publish --tag="filament-panel-switcher-config") — that's where panel lists and display defaults usually live.
  3. composer.json constraints — v0.6.6 adds Laravel 13 support, so confirm the illuminate/* and filament/* constraints match your stack before upgrading.

First use case: an admin panel plus a separate "app"/customer panel, where staff need to hop between them without logging out or hand-editing the URL. Wire the plugin onto both panels, then verify the switcher only lists panels the current user can actually enter.

Implementation Patterns

Register per panel, not globally. Filament plugins are panel-scoped by design. If you register the switcher only on the admin panel, users on the app panel get no way back. Register on every panel in the set — usually via a shared trait or base panel provider so the config stays in one place.

Drive the panel list from a single source of truth. Keep a config array (or an enum) of panel IDs → labels → URLs, and have each panel provider resolve from it. This avoids drift where the switcher offers a panel that no longer exists.

Gate visibility with authorization. Wrap the switcher in a canAccess()/canViewPanel() check per target panel — Filament's canAccessPanel() on the User model is the natural hook. Rendering a link to a panel the user will be 403'd from is the most common complaint with this class of plugin.

Combine with tenancy carefully. In multi-tenant setups the target panel URL usually needs a tenant slug. Prefer generating links through Filament's panel URL resolution ($panel->getUrl()) rather than string concatenation, and test with a non-default tenant.

Upgrade posture for v0.6.6. This release is a compatibility bump (Laravel 13). In composer.json, widen your constraints and run the suite; there are no reported API changes, so no code edits should be needed. Pin ^0.6.6 if you're on Laravel 13, and keep the lockfile pinned otherwise.

Gotchas and Tips

  • Pre-1.0 churn. At v0.6.x the fluent API can rename between minors. Wrap plugin configuration in your own helper method so a rename is a one-line fix, and read the changelog before every minor bump.
  • Cached config and routes. After changing panel registration, run php artisan filament:optimize-clear (or optimize:clear) and route:clear. A stale panel list in the switcher is nearly always a cache issue, not a bug.
  • Panel IDs vs. paths. Filament identifies panels by ID, which may differ from the URL path. Configure by ID; log the resolved IDs if the switcher looks empty.
  • Current-panel highlighting. The plugin may not detect the active panel reliably behind a custom domain or subdirectory. If highlighting is wrong, check APP_URL and any reverse-proxy TrustProxies config before patching the view.
  • View overrides are the safe extension point. Publish the views (--tag="filament-panel-switcher-views") to restyle the switcher rather than subclassing internals; published views survive minor upgrades far better than method overrides.
  • Debugging an empty switcher: dump the resolved panel list in a service provider, confirm the user passes canAccessPanel(), then confirm the plugin is registered on the current panel (not just the target).
  • Production check before upgrading: run composer why-not henryonsoftware/filament-panel-switcher ^0.6.6 after the bump — it surfaces any transitive Filament/Laravel constraint still holding you back, which is the usual failure mode for a compatibility-only release.
  • Testing. A single feature test asserting the switcher renders a link per accessible panel, and omits inaccessible ones, catches most regressions from upgrades like this one.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel
draftsmaninc/draftsman
square-bit/laravel-volition
himito/laravel-mailman
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log