rupadana/filament-panel-switch
Composer 安装命令:
composer require rupadana/filament-panel-switch
包简介
Easily Switch between your Filament Panels
README 文档
README
Panel Switch
Easily switch between panels in Filament.
Installation
You can install the package via composer:
composer require bezhansalleh/filament-panel-switch
That's it, no other steps are required.
Configuration
Right now you can configure a couple things for the plugin. By calling the PanelSwitch class's configureUsing() method inside a service provider's boot() method.
public function boot() { PanelSwitch::configureUsing(function (PanelSwitch $panelSwitch) { // }); }
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.
PanelSwitch::configureUsing(function (PanelSwitch $panelSwitch) { $panelSwitch ->visible(fn (): bool => auth()->user()?->hasAnyRole([ 'admin', 'general_manager' 'super_admin', ])); });
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.
PanelSwitch::configureUsing(function (PanelSwitch $panelSwitch) { $panelSwitch ->canSwitchPanels(fn (): bool => auth()->user()?->can('switch_panels')); });
Panel Exclusion
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' ]); });
Placement
You can choose where the panel switch menu should be placed. By default panel switch menu is rendered via 'panels::topbar.start' Hook. But you can change it to anyone of the other available hooks.
PanelSwitch::configureUsing(function (PanelSwitch $panelSwitch) { $panelSwitch->renderHook('panels::global-search.before'); });
The PanelSwitch has a fluent api so you can chain the methods together and configure everything in one go.
PanelSwitch::configureUsing(function (PanelSwitch $panelSwitch) { $panelSwitch ->visible(fn (): bool => auth()->user()?->hasAnyRole([ 'admin', 'general_manager' 'super_admin', ])) ->canSwitchPanels(fn (): bool => auth()->user()?->can('switch_panels')) ->excludes([ 'saas' ]) ->renderHook('panels::global-search.before'); });
Theming
By default the plugin uses the default filament theme, but you can customize it by adding the view path into the content array of your panels' tailwind.config.js file:
export default {
content: [
// ...
'./vendor/bezhansalleh/filament-panel-switch/resources/views/panel-switch-menu.blade.php',
],
// ...
}
Optionally, you can publish the views using
php artisan vendor:publish --tag="filament-panel-switch-views"
Testing
composer test
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-swtichdirectory, create a branch for your fix, e.g.fix/error-message.
Install the packages in your app's composer.json:
"require": { "bezhansalleh/filament-panel-switch": "dev-fix/error-message as main-dev", }, "repositories": [ { "type": "path", "url": "filament-panel-swtich" } ]
Now, run composer update.
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.
rupadana/filament-panel-switch 适用场景与选型建议
rupadana/filament-panel-switch 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 09 月 11 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「filament」 「bezhanSalleh」 「panel-switch」 「filament-panel-switch」 「panel-changer」 「panel-navigation」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 rupadana/filament-panel-switch 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 rupadana/filament-panel-switch 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 rupadana/filament-panel-switch 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Easily Switch between your Filament Panels
A Set of Filament Component Addons with different designs and extra functionalities
A Simple & Beautiful Pluggable Exception Viewer for FilamentPHP's Admin Panel
Filament support for `spatie/laravel-permission`.
A Simple & Beautiful Pluggable Exception Viewer for FilamentPHP's Admin Panel
Google Analytics integration with Filamentphp (FilamentAdmin)
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 21
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-09-11

