PHP code example of shuxx / filament-navigation

1. Go to this page and download the library: Download shuxx/filament-navigation library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

shuxx / filament-navigation example snippets


use Shuxx\FilamentNavigation\FilamentNavigationPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugin(FilamentNavigationPlugin::make());
}

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,
        ],
    ],
];

[
    'type' => 'group',
    'label' => 'Settings',
    'icon' => 'heroicon-o-cog-6-tooth',
    'collapsible' => true,  // optional, default: true
    'items' => [
        // ... sub-items
    ],
]

[
    'type' => 'link',
    'label' => 'Dashboard',
    'url' => '/admin/dashboard',
    'icon' => 'heroicon-o-home',  // optional
    'external' => false,  // optional, opens in new tab if true
]

[
    'type' => 'separator',
    'style' => 'default',  // optional, see styles below
]

FilamentNavigationPlugin::make()
    ->disableSeparatorHover(false)

[
    'type' => 'group',
    'icon' => 'heroicon-o-user-group',  // ✅ Icon here
    'items' => [
        ['label' => 'Users', 'url' => '...'],  // ❌ No icons
    ],
]

[
    'type' => 'group',
    // ❌ No icon on group
    'items' => [
        ['label' => 'Users', 'icon' => 'heroicon-o-users'],  // ✅ Icons here
    ],
]
bash
php artisan vendor:publish --tag="filament-navigation-config"