osamaatef/filament-drilldown-sidebar
Composer 安装命令:
composer require osamaatef/filament-drilldown-sidebar
包简介
A Filament plugin that adds optional drill-down navigation to sidebar groups.
README 文档
README
A Filament plugin that turns selected sidebar groups into clickable buttons that slide into a detail view. Supports inline nested sub-groups, auto-discovery from resources/pages, and an optional live search.
Groups not marked for drill-down keep the standard Filament collapsible accordion. Both styles coexist in the same sidebar, rendered in their original registration order.
Requirements
- PHP 8.1+
- Filament 3.x, 4.x, or 5.x
- Laravel 10, 11, or 12
Version Compatibility
| Plugin Version | Filament | Laravel |
|---|---|---|
| 1.x | 3.x, 4.x, 5.x | 10, 11, 12 |
The plugin automatically detects your Filament version and publishes the correct sidebar view:
- Filament 3.x: Blade component override (
components/sidebar/index.blade.php) - Filament 4.x / 5.x: Livewire view override (
livewire/sidebar.blade.php)
After upgrading Filament to a new major version, re-publish the views:
php artisan vendor:publish --tag=drilldown-sidebar-views --force
Installation
composer require osamaatef/filament-drilldown-sidebar
Publish the sidebar view:
php artisan vendor:publish --tag=drilldown-sidebar-views --force
The
--forceflag is required because this plugin overrides Filament's default sidebar view.
Basic Usage
Register the plugin in your panel provider and list the group labels that should use drill-down navigation:
use OsamaAtef\DrilldownSidebar\DrilldownSidebarPlugin; public function panel(Panel $panel): Panel { return $panel ->plugins([ DrilldownSidebarPlugin::make() ->drilledGroups([ 'Service Management', 'Content Management', ]), ]); }
Groups listed in drilledGroups() render as buttons with chevrons. Clicking one slides into a detail view with that group's items and a back button. All other groups render as the standard Filament collapsible accordion.
Nested Sub-groups
A drilled parent group can contain nested sub-groups. Inside the drill detail, each sub-group renders as a native Filament collapsible sidebar.group — so the UI remains consistent with the rest of the panel.
Option A — Declarative (recommended)
Declare the parent on each Resource / Page via a static $navigationParentGroup property. The plugin reflects over the panel's registered Resources and Pages and builds the hierarchy automatically.
// app/Filament/Resources/WorkshopResource.php class WorkshopResource extends Resource { protected static ?string $navigationGroup = 'Activities'; protected static ?string $navigationParentGroup = 'Lighthouse'; } // app/Filament/Resources/SportResource.php class SportResource extends Resource { protected static ?string $navigationGroup = 'Activities'; protected static ?string $navigationParentGroup = 'Lighthouse'; }
// In AdminPanelProvider: DrilldownSidebarPlugin::make() ->drilledGroups(['Lighthouse']);
Result: clicking Lighthouse opens a detail view containing an Activities sub-group with Workshop and Sport items nested inside.
Option B — Explicit map (overrides auto-discovery)
DrilldownSidebarPlugin::make() ->drilledGroups(['Lighthouse']) ->subGroups([ 'Lighthouse' => ['Activities', 'Bookings', 'Analytics'], ]);
When subGroups() is set, auto-discovery is skipped and your map wins.
Virtual parent groups
A drilled parent doesn't need direct items — if all its content lives in sub-groups (none of its resources register $navigationGroup = the parent label directly), the plugin still renders the drill button. Its icon falls back to the first sub-group's icon.
Ordering
Sub-groups are sorted by their position in your panel's ->navigationGroups([...]) array — the same list that orders top-level groups. Labels missing from that array fall to the end.
->navigationGroups([ 'Lighthouse', 'Activities', 'Bookings', 'Analytics', // ... ])
In the drill detail, children of Lighthouse will appear in this same order. If you want a different order, reorder the labels.
Manual ->subGroups([...]) config is used as-is (no re-sort).
Live Search
Optional inline search input inside the drill detail view. Filters the parent's direct items by label (case-insensitive substring match).
DrilldownSidebarPlugin::make() ->drilledGroups(['Service Management']) ->withSearch(); // enable // ->withSearch(false) to explicitly disable
Search is off by default.
Auto-drill
If the current page belongs to a drilled group or any of its sub-groups, the sidebar opens that group's detail view automatically on page load — no extra wiring required.
Collapsed sidebar
When the sidebar is collapsed to icon-only mode, all groups use Filament's default icon dropdown regardless of drill-down status.
How It Works (summary)
- Main view: ungrouped items first, then labeled groups in registration order. Drilled groups show as buttons; standard groups show as collapsible accordions.
- Detail view: sliding panel with the group's title, icon, direct items, and any nested sub-groups rendered as native Filament collapsible groups. A back button returns to the main view.
- Sub-groups are inline, not a 3rd-level slide — the nav hierarchy stays two levels deep.
Screenshot
Changelog
- 1.4.3 — Sort auto-discovered sub-groups by panel
navigationGroups()order. - 1.4.2 — Render drill button + detail panel for parents that have only sub-groups (no direct items).
- 1.4.1 — Include panel Pages in sub-group auto-discovery (alongside Resources).
- 1.4.0 — Auto-discover sub-groups from
$navigationParentGroupon Resources; sub-groups render inline as native Filament groups; redesigned drill detail header; fallback to native Filament rendering for non-drilled parents. - 1.3.x — Manual
->subGroups([...])config, optional->withSearch()live search. - 1.x — Initial drill-down support.
License
MIT License. See LICENSE for details.
osamaatef/filament-drilldown-sidebar 适用场景与选型建议
osamaatef/filament-drilldown-sidebar 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 846 次下载、GitHub Stars 达 9, 最近一次更新时间为 2026 年 04 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「navigation」 「laravel」 「sidebar」 「Drilldown」 「filament」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 osamaatef/filament-drilldown-sidebar 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 osamaatef/filament-drilldown-sidebar 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 osamaatef/filament-drilldown-sidebar 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Laravel Nova package that adds a notification feed in your Nova app.
Easily switch between entry types in entries section
A block to display a list of links to child pages, or pages in current level
A Laravel Nova collapsible sidebar.
Displays a list of tags that the user is following in the sidebar.
A custom sidebar menu with collapsible groups
统计信息
- 总下载量: 846
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 9
- 点击次数: 28
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-04-13
