laralabs/menu
Composer 安装命令:
composer require laralabs/menu
包简介
Menu package for Laravel, build it with classes, and render it how you want to from a collection/array/json.
README 文档
README
Laralabs Menu
Simple, extendable menu package for Laravel.
You define how it renders, the package just gives you the data to do it with.
- Attach to a blade file via a view composer.
- Pass data into a Vue component, or do whatever you want with it!
🚀 Quick Start
Installation
Require the package in the composer.json of your project.
composer require laralabs/menu
Publish the configuration file.
php artisan vendor:publish --tag=laralabs-menu-config
Not much in the configuration file at the moment, but you can choose to register your menus in here if you wish.
Usage
Add the ResolveMenus middleware to your app/Http/Kernel.php in the $middleware array:
protected $middleware = [
// Existing Middleware
\Laralabs\Menu\Middleware\ResolveMenus::class,
];
Currently there are no make commands, but there are example menus found in the tests/Fakes directory.
Build a class that extends Laralabs\Menu\Contracts\Menu and implement the required methods.
Extenders can be built by creating a class that extends implements Laralabs\Menu\Contracts\MenuExtender, edit the menu and then return then return it out of the handle method with the closure $next($menu).
Quick example of creating a menu in the build() method:
public function build(): void
{
$this->menu->group('groupOne', static function (Group $group) {
$group->item('Group One, Item One', function (Item $item) {
$item->subItem('Sub Item');
});
});
}
📙 Documentation
Documentation TBC, take a look at the tests :)
💬 Support
Please raise an issue on GitHub if there is a problem.
🔑 License
This is open-sourced software licensed under the MIT License.
🙏 Credits
Adapted from Maatwebsite/Laravel-Sidebar for my own requirements, thank you to everyone at Maatwebsite for the work they do. Also, theirs might have a feature mine doesn't so go check it out too!
laralabs/menu 适用场景与选型建议
laralabs/menu 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 11 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 11 月 18 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 laralabs/menu 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 laralabs/menu 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 11
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 7
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-11-18