Download the PHP package bezhansalleh/filament-panel-switch without Composer
On this page you can find all versions of the php package bezhansalleh/filament-panel-switch. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bezhansalleh/filament-panel-switch
More information about bezhansalleh/filament-panel-switch
Files in bezhansalleh/filament-panel-switch
Package filament-panel-switch
Short Description Easily Switch between your Filament Panels
License MIT
Homepage https://github.com/bezhansalleh/filament-panel-switch
Informations about the package filament-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.
Table Of Contents
-
Panel Switch
-
Installation
-
Configuration
-
Panel Access & Navigation
-
Design or Style
-
Labels
-
Icons
-
Sort Order
-
Placement
-
Full Example
-
Changelog
-
Contributing
-
Security Vulnerabilities
-
Credits
-
License
Compatibility
- Installation
-
Configuration
- Panel Access & Navigation
- Design or Style
- Labels
- Icons
- Sort Order
- Placement
- Full Example
- Changelog
- Contributing
- Security Vulnerabilities
- Credits
- License
| Package Version | Filament Version |
|---|---|
| 1.x | 3.x |
| 2.x | 4.x & 5.x |
| 3.x - current | 4.x & 5.x |
Installation
You can install the package via composer:
[!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.cssfile:
Now build your theme using:
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
Start your custom configuration using the configureUsing method in your service provider's boot method:
Panel Access & Navigation
The panel switch is automatically visible when the authenticated user has access to two or more panels. Panel access is determined via the canAccessPanel method on your User model — no additional configuration needed. Panels the user cannot access are automatically hidden from the switch.
To further limit which panels appear in the switch, use the panels() method:
The 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.
Design or Style
The plugin supports two design styles:
-
Modern (default) — Uses Filament's Modal Blade component. You can customize the modal heading, width, or use a slide-over:
- Simple — A dropdown list for switching panels directly:
For full control over the look and feel, you can publish the views and make your own adjustments:
Labels
Provide custom labels for each panel. The keys should be valid panel IDs, and values can be strings or translatable strings:
Icons
Define icons for each panel using the icons() method. The keys should be valid panel IDs:
For images instead of icons, set the asImage parameter to true:
Use iconSize() to customize the size (default 128px). The value is multiplied by 4:
Sort Order
By default panels are listed in registration order, or in the order provided via panels(). Use sort() to sort alphabetically:
Placement
By default the panel switch is rendered via the panels::global-search.before render hook. You can change this to any available Filament Render Hook:
Full Example
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
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-switchdirectory, create a branch for your fix, e.g.fix/error-message.
Install the packages in your app's composer.json:
Now, run composer update.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Bezhan Salleh
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of filament-panel-switch with dependencies
filament/filament Version ^4.0|^5.0
illuminate/support Version ^11.28|^12.0|^13.0
league/uri Version ^7.0
spatie/laravel-package-tools Version ^1.9