| Install | |
|---|---|
composer require shuxx/filament-navigation |
|
| Latest Version: | v1.0.0 |
| PHP: | ^8.1|^8.2|^8.3 |
Configure your Filament navigation via a simple PHP configuration file - no manual navigation building required!
Perfect for applications where navigation needs to be easily manageable, version-controlled, and consistent across environments.
target="_blank"Install via composer:
composer require shuxx/filament-navigation
Publish the configuration file:
php artisan vendor:publish --tag="filament-navigation-config"
This creates config/filament-navigation.php.
In app/Providers/Filament/AdminPanelProvider.php:
use Shuxx\FilamentNavigation\FilamentNavigationPlugin;
public function panel(Panel $panel): Panel
{
return $panel
->plugin(FilamentNavigationPlugin::make());
}
Edit config/filament-navigation.php:
return [
'items' => [
// Dashboard
[
'type' => 'link',
'label' => 'Dashboard',
'url' => '/admin',
'icon' => 'heroicon-o-home',
],
// Separator
['type' => 'separator', 'style' => 'default'],
// Users Group
[
'type' => 'group',
'label' => 'Users',
'icon' => 'heroicon-o-user-group',
'collapsible' => true,
'items' => [
['type' => 'link', 'label' => 'All Users', 'url' => '/admin/users'],
['type' => 'link', 'label' => 'Roles', 'url' => '/admin/roles'],
],
],
['type' => 'separator', 'style' => 'dots'],
// External link
[
'type' => 'link',
'label' => 'Documentation',
'url' => 'https://filamentphp.com/docs',
'icon' => 'heroicon-o-book-open',
'external' => true,
],
],
];
That's it! Your navigation is now configured. 🎉
Creates a collapsible navigation group:
[
'type' => 'group',
'label' => 'Settings',
'icon' => 'heroicon-o-cog-6-tooth',
'collapsible' => true, // optional, default: true
'items' => [
// ... sub-items
],
]
Creates a navigation link:
[
'type' => 'link',
'label' => 'Dashboard',
'url' => '/admin/dashboard',
'icon' => 'heroicon-o-home', // optional
'external' => false, // optional, opens in new tab if true
]
Creates a visual separator:
[
'type' => 'separator',
'style' => 'default', // optional, see styles below
]
default → ───────────long → ────────────────double → ═══════════thick → ━━━━━━━━━━━dash → - - - - - - - -underscore → ___________dots → • • • • • • • •circle → ○ ○ ○ ○ ○ ○circle-filled → ● ● ● ● ● ●ellipsis → ⋯ ⋯ ⋯ ⋯ ⋯square → ▪ ▪ ▪ ▪ ▪ ▪diamond → ◆ ◆ ◆ ◆ ◆triangle → ▸ ▸ ▸ ▸ ▸ ▸arrow → → → → → →chevron → › › › › › ›stars → ★ ★ ★ ★ ★hearts → ♥ ♥ ♥ ♥ ♥plus → + + + + + + +cross → ✕ ✕ ✕ ✕ ✕wave → ~~~~~~~wavy → 〰〰〰〰〰zigzag → ﹏﹏﹏﹏﹏space → (large empty space)blank → · (minimal visible space)By default, separators have hover effects disabled. You can enable them:
FilamentNavigationPlugin::make()
->disableSeparatorHover(false)
In Filament 4, you cannot have icons on both the group AND its items. Choose one:
Option 1 - Icons on groups (recommended):
[
'type' => 'group',
'icon' => 'heroicon-o-user-group', // ✅ Icon here
'items' => [
['label' => 'Users', 'url' => '...'], // ❌ No icons
],
]
Option 2 - Icons on items:
[
'type' => 'group',
// ❌ No icon on group
'items' => [
['label' => 'Users', 'icon' => 'heroicon-o-users'], // ✅ Icons here
],
]
The order of items in your config array is the display order. The plugin transforms everything into navigation groups internally to maintain order control (a Filament 4 requirement).
composer test
Please see CHANGELOG for recent changes.
Contributions are welcome! Please see CONTRIBUTING for details on:
Need help or have questions?
If you discover any security-related issues, please email the author directly instead of using the issue tracker. All security vulnerabilities will be promptly addressed.
The MIT License (MIT). Please see License File for more information.
Made with ❤️ for the Filament community
⭐ Star this repo if you find it helpful!