osamaatef / filament-drilldown-sidebar
A Filament plugin that adds optional drill-down navigation to sidebar groups.
Package info
github.com/osamaatef1/filament-drilldown-sidebar
pkg:composer/osamaatef/filament-drilldown-sidebar
Requires
- php: ^8.1
- filament/filament: ^3.0||^4.0||^5.0
- illuminate/contracts: ^10.0||^11.0||^12.0||^13.0
README
A Filament plugin that adds optional drill-down navigation to sidebar groups. Instead of the default collapsible accordion, selected groups display as clickable buttons that slide into a detail view showing the group's items.
Groups not marked for drill-down keep the standard Filament collapsible behavior. Both styles can 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: Publishes a Blade component override (
components/sidebar/index.blade.php) - Filament 4.x / 5.x: Publishes a Livewire view override (
livewire/sidebar.blade.php)
Note: 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
Important: The
--forceflag is required because this plugin overrides Filament's default sidebar view. Without--force, Laravel will skip the publish if the file already exists (e.g., from Filament's own view or a previous installation).
Usage
Register the plugin in your panel provider and pass the labels of the groups 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() will render as a button with a chevron. Clicking it slides into a detail view with the group's items and a back button. All other groups render as the standard Filament collapsible accordion.
How It Works
- Main view: Ungrouped items (Dashboard, etc.) appear first, followed by all labeled groups in their original registration order. Drilled groups show as buttons; standard groups show as collapsible accordions.
- Detail view: Clicking a drilled group slides in a panel showing the group title, icon, and its navigation items. A back button returns to the main view.
- Collapsed sidebar: When the sidebar is collapsed (icon-only mode), all groups use Filament's default icon dropdown regardless of drill-down status.
- Auto-drill: If the current page belongs to a drilled group, the sidebar automatically opens that group's detail view on page load.
Screenshot
License
MIT License. See LICENSE for details.
