bambamboole/filament-menu
Composer 安装命令:
composer require bambamboole/filament-menu
包简介
Create menus with ease in Filament
README 文档
README
A menu builder plugin for Filament that lets you create and manage navigation menus with drag-and-drop ordering, nesting, and linkable Eloquent models.
Installation
composer require bambamboole/filament-menu
Usage
Register the plugin in your panel provider:
use Bambamboole\FilamentMenu\FilamentMenuPlugin; public function panel(Panel $panel): Panel { return $panel ->plugins([ FilamentMenuPlugin::make() ->locations(['header', 'footer', 'sidebar']) ->linkables([Page::class, Post::class]) ->canAccess(fn () => auth()->user()->isAdmin()) ->cacheFor(3600), ]); }
| Method | Description |
|---|---|
locations(array) |
Named positions where menus can be assigned (e.g. header, footer) |
linkables(array) |
Eloquent models that can be linked as menu items |
canAccess(Closure) |
Controls who can manage menus |
cacheFor(int) |
Cache duration in seconds (auto-invalidated on changes) |
Linkable Models
To let editors link menu items to your Eloquent models, implement the Linkable interface:
use Bambamboole\FilamentMenu\Contracts\Linkable; use Bambamboole\FilamentMenu\Concerns\IsLinkable; use Illuminate\Database\Eloquent\Builder; class Page extends Model implements Linkable { use IsLinkable; public static function getLinkableQuery(): Builder { return static::query()->where('published', true); } public static function getNameColumn(): string { return 'title'; } public function getLink(): string { return route('pages.show', $this->slug); } }
The IsLinkable trait provides sensible defaults — override only what you need.
Rendering Menus
Use the Blade component in your templates:
<x-filament-menu::menu location="header" /> <x-filament-menu::menu slug="main-navigation" />
Or retrieve menus programmatically:
use Bambamboole\FilamentMenu\Models\Menu; $menu = Menu::findByLocation('header'); $tree = $menu->getTree(); // array of nested items
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.
bambamboole/filament-menu 适用场景与选型建议
bambamboole/filament-menu 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 722 次下载、GitHub Stars 达 1, 最近一次更新时间为 2026 年 02 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「filament」 「bambamboole」 「filament-plugin」 「filamentphp」 「filament-menu」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 bambamboole/filament-menu 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 bambamboole/filament-menu 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 bambamboole/filament-menu 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A laravel package to dump missing translation keys into the translation files
A laravel package to effortlessly sync translations with Lokalise
A laravel package which provides a smooth OAS workflow
This is my package laravel-mermaid-erd
Manage application settings with a Filament UI
Alfabank REST API integration
统计信息
- 总下载量: 722
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 23
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-02-19