Skip to content

akira-io/filament-switch-panel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Filament Switch Panel

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Installation

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"

Customisation

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')

});

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

No description, website, or topics provided.

Resources

License

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published