typicms/sidebar
Composer 安装命令:
composer require typicms/sidebar
包简介
A sidebar builder for TypiCMS
README 文档
README
This package is based on SpartnerNL/Laravel-Sidebar v1
Installation
Require this package in your composer.json and run composer update.
"typicms/sidebar": "~1.0.0"
After updating composer, add the ServiceProvider to the providers array in bootstrap/providers.php
'TypiCMS\Modules\Sidebar\SidebarServiceProvider::class',
To publish the default views use:
php artisan vendor:publish
Adding a menu
// Or use dependency injection $builder = app('TypiCMS\Modules\Sidebar\SidebarManager'); $builder->group('app', function ($group) { $group->addItem('dashboard', function($item) { // Route method automatically transforms it into a route $item->route('admin::dashboard'); // If you want to call route() yourself to pass optional parameters $item->route = route('admin::dashboard'); }); }
Groups
It’s possible to group the menu items. A little header will be rendered to separate the different menu items.
Adding items
The first parameter of $group->addItem() is the name. The name field will automatically be translated through the menu translation file. (e.g. menu.dashboard). If the translation does not exists, the given name will be displayed.
The second parameter is optionally a callback. Alternatively you can chain the methods.
You can change the route, name and icon. If you route given it will automatically be translated to acp.{$name}.index.
Without group headings
To disable rendering of the group headings, you can easily use $builder->withoutGroup(). Group headings will now be ignored.
Authorization
By default, all groups and items are public for all users. You can use ->authorized(false) on all these objects to disable them or use any condition you want.
Advanced usage
If you have multiple sidebars, you can extend the SidebarManager and register a new singleton:
class AdminSidebar extends SidebarManager { public function build($callback = null) { $this->group('application', function(SidebarGroup $group) { $group->addItem(...) }); } }
typicms/sidebar 适用场景与选型建议
typicms/sidebar 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.86k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 08 月 18 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 typicms/sidebar 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 typicms/sidebar 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 2.86k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 10
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-08-18