| Install | |
|---|---|
composer require akira/filament-switch-panel |
|
| Latest Version: | v1.3.1 |
| PHP: | ^8.1 |
You can install the package via composer:
composer require akira/filament-switch-panel
optionally, you can publish the views to customise the switch panel.
php artisan vendor:publish --tag="filament-switch-panel-views"
This package supports both Filament v3.x and Filament v4.x. The package will automatically detect the installed version and work seamlessly with either version.
to start your customisation, use the configureUsing method in your service provider's boot method.
use Akira\FilamentSwitchPanel\FilamentSwitchPanel;
FilamentSwitchPanel::configureUsing(function (FilamentSwitchPanel $switchPanel) {
$switchPanel->modalHeading('Modal Heading')
->modalWidth('md')
->slideOver()
->simple()
->labels([
'admin' => 'Admin',
'user' => 'User',
])
->icons([
'admin' => 'heroicon-o-user',
'user' => 'heroicon-o-user',
], $asImage = false)
->iconSize(32)
->visible(fn (): bool => auth()->user()?->hasAnyRole(['admin',]))
->canSwitchPanels(fn (): bool => auth()->user()?->can('switch-panels'))
->excludes(['user'])
->renderHook('panels::global-search.before')
});
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.