PHPackages                             adultdate/filament-panel-switch - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. adultdate/filament-panel-switch

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

adultdate/filament-panel-switch
===============================

Easily Switch between your Filament Panels

2.0.0(8mo ago)02MITPHPPHP ^8.2

Since Aug 5Pushed 4mo agoCompare

[ Source](https://github.com/adultdate/filament-panel-switch)[ Packagist](https://packagist.org/packages/adultdate/filament-panel-switch)[ Docs](https://github.com/bezhansalleh/filament-panel-switch)[ GitHub Sponsors](https://github.com/bezhanSalleh)[ RSS](/packages/adultdate-filament-panel-switch/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (6)Versions (19)Used By (0)

[](https://github.com/adultdate/filament-panel-switch)[![Panel Switch](https://repository-images.githubusercontent.com/674460446/9c4530cf-420e-4745-a401-0be18d1dd09d "Panel Switch")](https://repository-images.githubusercontent.com/674460446/9c4530cf-420e-4745-a401-0be18d1dd09d)

 [ ![FILAMENT 4.x](https://camo.githubusercontent.com/13befbe0cffd101b2484ce1cdd985dabcddcbf1176d17a675674d53af99cfdbc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f46494c414d454e542d342e782d4542423330343f7374796c653d666f722d7468652d6261646765) ](https://filamentphp.com/docs/4.x/introduction/overview) [ ![Packagist](https://camo.githubusercontent.com/3f6685c24f3b50e16be707d48a79ed81fdffabaafb5c03102e47767b911b4bc6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6164756c74646174652f66696c616d656e742d70616e656c2d7377697463682e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d7061636b6167697374) ](https://packagist.org/packages/adultdate/filament-panel-switch) [ ![Code Style Passing](https://camo.githubusercontent.com/f02c3f40d89f44bb3e07464cc28bcf56b73d7a6588eebeb0037f5e0249e5b488/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6164756c74646174652f66696c616d656e742d70616e656c2d7377697463682f6669782d7068702d636f64652d7374796c696e672e796d6c3f7374796c653d666f722d7468652d6261646765266c6f676f3d676974687562266c6162656c3d636f64652532307374796c65) ](https://github.com/adultdate/filament-panel-switch/actions?query=workflow%3A)[ ![Downloads](https://camo.githubusercontent.com/550235c4e20ca6d657b2cb0fdef2901fb3e90ac1bb5f3700b0a409f22fcd2ef2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6164756c74646174652f66696c616d656e742d70616e656c2d7377697463682e7376673f7374796c653d666f722d7468652d6261646765) ](https://packagist.org/packages/adultdate/filament-panel-switch)

Panel Switch
============

[](#panel-switch)

The Panel Switch Plugin for Filament offers a robust and customizable component for switching between panels in applications built with FilamentPHP.

[![Demo](https://raw.githubusercontent.com/bezhanSalleh/filament-panel-switch/master/art/modern-icon-demo.gif?raw=true "Modern Icon Demo")](https://raw.githubusercontent.com/bezhanSalleh/filament-panel-switch/master/art/modern-icon-demo.gif?raw=true)[![Demo](https://raw.githubusercontent.com/bezhanSalleh/filament-panel-switch/master/art/modern-image-demo.gif?raw=true "Modern Image Demo")](https://raw.githubusercontent.com/bezhanSalleh/filament-panel-switch/master/art/modern-image-demo.gif?raw=true)[![Demo](https://raw.githubusercontent.com/bezhanSalleh/filament-panel-switch/master/art/demo.gif?raw=true "Simple Demo")](https://raw.githubusercontent.com/bezhanSalleh/filament-panel-switch/master/art/demo.gif?raw=true)

Table Of Contents
-----------------

[](#table-of-contents)

- [Panel Switch](#panel-switch)
    - [Installation](#installation)
    - [Configuration](#configuration)
        - [Design or Style](#design-or-style)
        - [Labels](#labels)
        - [Icons/Images](#iconsimages)
        - [Icon/Image Size](#iconimage-size)
        - [Visibility](#visibility)
        - [Who Can Switch Panels?](#who-can-switch-panels)
        - [Panel \[New 1.0.7\]](#panels)
        [Sort Order \[New 1.0.7\]](#sort-order)- [Placement](#placement)
        - [Usage](#usage)
        [Panel Exclusion \[@deprecated\]](#panel-exclusion)
    - [Changelog](#changelog)
    - [Contributing](#contributing)
    - [Security Vulnerabilities](#security-vulnerabilities)
    - [Credits](#credits)
    - [License](#license)

#### Compatibility

[](#compatibility)

Package VersionFilament Version[v1](https://github.com/bezhanSalleh/filament-panel-switch/tree/1.x)[v3](https://filamentphp.com/docs/3.x/panels/installation)v2[v4](https://filamentphp.com/docs/4.x/introduction/overview)Installation
------------

[](#installation)

You can install the package via composer:

```
composer require adultdate/filament-panel-switch
```

Important

The plugin follows Filament's theming rules. So, to use the plugin create a custom theme if you haven't already, and add the following line to your `theme.css` file:

```
@source '../../../../vendor/adultdate/filament-panel-switch/resources/views/**/*.blade.php';
```

Now build your theme using:

```
npm run build
```

---

Upon installation, the Plugin seamlessly integrates with Filament without any further setup. Though the plugin works out-of-the-box, it's designed for customization. Delve into the Configuration section below for detailed customization options.

Configuration
-------------

[](#configuration)

Start your custom configuration using the `configureUsing` method in your service provider's boot method:

```
use BezhanSalleh\PanelSwitch\PanelSwitch;

PanelSwitch::configureUsing(function (PanelSwitch $panelSwitch) {
    // Custom configurations go here
});
```

### Design or Style

[](#design-or-style)

By default, the Plugin uses Filament's [Modal Blade component](https://filamentphp.com/docs/3.x/support/blade-components/modal) as the modern design for the panel switch menu. But you can change it to the simple design by using the `simple()` method.

- #### Modern

    [](#modern)

    - ##### Modal Heading

        [](#modal-heading)

        Set a custom Modal Heading for the Panel Switcher. By default, the modal heading is set to `Switch Panels`. ```
            use BezhanSalleh\PanelSwitch\PanelSwitch;

            PanelSwitch::configureUsing(function (PanelSwitch $panelSwitch) {
                $panelSwitch->modalHeading('Available Panels');
            });
        ```
    - ##### Modal Width

        [](#modal-width)

        By default, the modal width is set to `screen` but you can use the options avaialbel for [Modal Blade component](https://filamentphp.com/docs/3.x/support/blade-components/modal#changing-the-modal-width). ```
            use BezhanSalleh\PanelSwitch\PanelSwitch;

            PanelSwitch::configureUsing(function (PanelSwitch $panelSwitch) {
                $panelSwitch->modalWidth('sm');
            });
        ```
    - ##### Slide-Over

        [](#slide-over)

        You can use the `slideOver()` method to open a `slide-over` dialog instead of the modal. ```
            use BezhanSalleh\PanelSwitch\PanelSwitch;

            PanelSwitch::configureUsing(function (PanelSwitch $panelSwitch) {
                $panelSwitch->slideOver();
            });
        ```
- #### Simple

    [](#simple)

    The `simple()` method transforms the panel switch menu to a dropdown list, allowing users to switch between panels directly from the list. ```
        use BezhanSalleh\PanelSwitch\PanelSwitch;

        PanelSwitch::configureUsing(function (PanelSwitch $panelSwitch) {
            $panelSwitch->simple();
        });
    ```

### Labels

[](#labels)

By using `labels()` method you can provide textual representation for each panel. The keys of the array should be valid panel IDs, and the values can be either regular strings or Laravel's translatable strings:

```
use BezhanSalleh\PanelSwitch\PanelSwitch;

PanelSwitch::configureUsing(function (PanelSwitch $panelSwitch) {
    $panelSwitch
        ->labels([
            'admin' => 'Custom Admin Label',
            'general_manager' => __('General Manager')
        ]);
});
```

### Icons/Images

[](#iconsimages)

Define icons/images for available panels using the `icons()` method which accepts an array. The keys of the array should be valid panel IDs. If using images instead of icons, set the `$asImage` parameter to `true` and the value of the array should be the path to the image meaning a valid url:

- **Icons**

```
use BezhanSalleh\PanelSwitch\PanelSwitch;

PanelSwitch::configureUsing(function (PanelSwitch $panelSwitch) {
    $panelSwitch->icons([
        'validPanelId1' => 'heroicon-o-square-2-stack',
        'validPanelId2' => 'heroicon-o-star',
    ], $asImage = false);
});
```

- **Images**

```
use BezhanSalleh\PanelSwitch\PanelSwitch;

PanelSwitch::configureUsing(function (PanelSwitch $panelSwitch) {
    $panelSwitch->icons([
        'validPanelId1' => 'https://raw.githubusercontent.com/bezhanSalleh/filament-panel-switch/3.x/art/banner.jpg',
        'validPanelId2' => 'https://raw.githubusercontent.com/bezhanSalleh/filament-panel-switch/3.x/art/banner.jpg',
    ], $asImage = true);
});
```

### Icon/Image Size

[](#iconimage-size)

Use the `iconSize()` method to set the size of the icons/images. The default size is `128px`. The value provided will be multiplied by 4 and then used as the size of the icon/image.

```
use BezhanSalleh\PanelSwitch\PanelSwitch;

PanelSwitch::configureUsing(function (PanelSwitch $panelSwitch) {
    // This would result in an icon/image size of 128 pixels.
    $panelSwitch->iconSize(32);
});
```

### Visibility

[](#visibility)

By default, the package checks whether the user can access the panel if so the switch will be visible. You can further customize whether the panel switch should be shown.

```
use BezhanSalleh\PanelSwitch\PanelSwitch;

PanelSwitch::configureUsing(function (PanelSwitch $panelSwitch) {
    $panelSwitch
        ->visible(fn (): bool => auth()->user()?->hasAnyRole([
            'admin',
            'general_manager',
            'super_admin',
        ]));
});
```

### Who Can Switch Panels?

[](#who-can-switch-panels)

You might want an option in a situation where you want a group of your users to see the panel but not be able to switch panels. You can do that by using the `canSwitchPanels()` method.

```
use BezhanSalleh\PanelSwitch\PanelSwitch;

PanelSwitch::configureUsing(function (PanelSwitch $panelSwitch) {
    $panelSwitch
        ->canSwitchPanels(fn (): bool => auth()->user()?->can('switch_panels'));
});
```

### Panels

[](#panels)

By default all the panels available will be listed in the panel switch menu. But by providing an array of panel ids to the `panels()` method you can limit the panels that will be listed.

```
PanelSwitch::configureUsing(function (PanelSwitch $panelSwitch) {
    $panelSwitch->panels([
        'admin',
        'dev',
        'app'
    ]);
});
```

Then `panels()` method also accepts a closure that returns an array of panel ids. This is useful when you want to dynamically determine the panels that will be listed. The plugin will also validate the panels to ensure that they are valid filament panels. If any of the panels provided are invalid, the plugin will throw an `InvalidArgumentException`.

### Sort Order

[](#sort-order)

By default the panels will be listed in the order they were registered in `config/app.php`'s `providers` array or in the order they are provided through the `panels()` method. But you can opt-in to sort the panels either in `asc` or `desc` order via `sort()` method.

```
PanelSwitch::configureUsing(function (PanelSwitch $panelSwitch) {
    $panelSwitch
        ...
        ->panels(['admin', 'dev', 'app']) // default order if `sort()` method not used
        ->sort() // ['admin', 'app', 'dev']
        // ->sort(order: 'desc') // ['dev', 'app', 'admin']
        ...
        ;
});
```

### Placement

[](#placement)

You can choose where the panel switch menu should be placed. By default panel switch menu is rendered via 'panels::global-search.before' `Hook`. But you can change it to anyone of the other available Filament [Render Hooks](https://filamentphp.com/docs/3.x/support/render-hooks#available-render-hooks).

```
use BezhanSalleh\PanelSwitch\PanelSwitch;

PanelSwitch::configureUsing(function (PanelSwitch $panelSwitch) {
    $panelSwitch->renderHook('panels::global-search.after');
});
```

### Usage

[](#usage)

The `Panel Switch Plugin` has a fluent api so you can chain the methods together and configure everything in one go.

```
use BezhanSalleh\PanelSwitch\PanelSwitch;

PanelSwitch::configureUsing(function (PanelSwitch $panelSwitch) {
    $panelSwitch
        ->panels(['admin', 'app', 'dev'])
        ->heading('Available Panels')
        ->modalWidth('sm')
        ->slideOver()
        ->icons([
            'admin' => 'heroicon-o-square-2-stack',
            'app' => 'heroicon-o-star',
        ])
        ->iconSize(16)
        ->labels([
            'admin' => 'Admin Panel',
            'app' => 'SaaS Application'
        ]);

});
```

### Panel Exclusion

[](#panel-exclusion)

**`@deprecated`** use **`panels()`** method instead. By default all the panels available will be listed in the panel switch menu. But you can exclude some of them by using the excludes() method.

```
PanelSwitch::configureUsing(function (PanelSwitch $panelSwitch) {
    $panelSwitch->excludes([
        'saas'
    ]);
});
```

Optionally, you can publish the views using

```
php artisan vendor:publish --tag="filament-panel-switch-views"
```

### Testing

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

If you want to contribute to this packages, you may want to test it in a real Filament project:

- Fork this repository to your GitHub account.
- Create a Filament app locally.
- Clone your fork in your Filament app's root directory.
- In the `/filament-panel-switch` directory, create a branch for your fix, e.g. `fix/error-message.`

Install the packages in your app's `composer.json:`

```
"require": {
    "adultdate/filament-panel-switch": "dev-fix/error-message as main-dev",
},
"repositories": [
    {
        "type": "path",
        "url": "filament-panel-switch"
    }
]
```

Now, run composer update.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Bezhan Salleh](https://github.com/bezhanSalleh)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance67

Regular maintenance activity

Popularity2

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 67.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~51 days

Recently: every ~30 days

Total

16

Last Release

245d ago

Major Versions

0.0.3 → 1.0.02023-09-19

1.x-dev → 2.0.02025-08-19

PHP version history (2 changes)0.0.1PHP ^8.1

2.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/cd883f243eac90139be92ab7cf99608411f09b2be1a64cd1b58cf6920362e473?d=identicon)[adultdate](/maintainers/adultdate)

---

Top Contributors

[![bezhanSalleh](https://avatars.githubusercontent.com/u/10007504?v=4)](https://github.com/bezhanSalleh "bezhanSalleh (83 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (13 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (6 commits)")[![adultdate](https://avatars.githubusercontent.com/u/10224381?v=4)](https://github.com/adultdate "adultdate (4 commits)")[![lucasgiovanny](https://avatars.githubusercontent.com/u/4853801?v=4)](https://github.com/lucasgiovanny "lucasgiovanny (4 commits)")[![pelmered](https://avatars.githubusercontent.com/u/680058?v=4)](https://github.com/pelmered "pelmered (4 commits)")[![gchaumont](https://avatars.githubusercontent.com/u/21203742?v=4)](https://github.com/gchaumont "gchaumont (3 commits)")[![ianlandsman](https://avatars.githubusercontent.com/u/53144?v=4)](https://github.com/ianlandsman "ianlandsman (1 commits)")[![ThijmenKort](https://avatars.githubusercontent.com/u/101055765?v=4)](https://github.com/ThijmenKort "ThijmenKort (1 commits)")[![andrewdwallo](https://avatars.githubusercontent.com/u/104294090?v=4)](https://github.com/andrewdwallo "andrewdwallo (1 commits)")[![ryanmortier](https://avatars.githubusercontent.com/u/2053960?v=4)](https://github.com/ryanmortier "ryanmortier (1 commits)")[![chengkangzai](https://avatars.githubusercontent.com/u/43839286?v=4)](https://github.com/chengkangzai "chengkangzai (1 commits)")[![zsp03](https://avatars.githubusercontent.com/u/112597617?v=4)](https://github.com/zsp03 "zsp03 (1 commits)")

---

Tags

filamentbezhanSallehpanel-switchfilament-panel-switchpanel-changerpanel-navigation

###  Code Quality

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/adultdate-filament-panel-switch/health.svg)

```
[![Health](https://phpackages.com/badges/adultdate-filament-panel-switch/health.svg)](https://phpackages.com/packages/adultdate-filament-panel-switch)
```

###  Alternatives

[bezhansalleh/filament-panel-switch

Easily Switch between your Filament Panels

159323.5k2](/packages/bezhansalleh-filament-panel-switch)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[bezhansalleh/filament-google-analytics

Google Analytics integration for FilamentPHP

205144.8k5](/packages/bezhansalleh-filament-google-analytics)[pboivin/filament-peek

Full-screen page preview modal for Filament

253319.6k12](/packages/pboivin-filament-peek)[dotswan/filament-map-picker

Easily pick and retrieve geo-coordinates using a map-based interface in your Filament applications.

124139.3k2](/packages/dotswan-filament-map-picker)[creagia/filament-code-field

A Filamentphp input field to edit or view code data.

58289.3k3](/packages/creagia-filament-code-field)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
