PHPackages                             ycookies/filament-nav-manager - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Admin Panels](/categories/admin)
4. /
5. ycookies/filament-nav-manager

ActiveLibrary[Admin Panels](/categories/admin)

ycookies/filament-nav-manager
=============================

A powerful navigation management package for Filament v4 that allows you to dynamically manage your Filament panel navigation menus

1.0.4(5mo ago)06[2 PRs](https://github.com/ycookies/filament-nav-manager/pulls)MITPHPPHP ^8.2CI passing

Since Dec 1Pushed 1mo agoCompare

[ Source](https://github.com/ycookies/filament-nav-manager)[ Packagist](https://packagist.org/packages/ycookies/filament-nav-manager)[ Docs](https://github.com/ycookies/filament-nav-manager)[ GitHub Sponsors](https://github.com/ycookies)[ RSS](/packages/ycookies-filament-nav-manager/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (14)Versions (7)Used By (0)

Filament Nav Manager
====================

[](#filament-nav-manager)

A powerful navigation management package for Filament v4 that allows you to dynamically manage your Filament panel navigation menus through a user-friendly interface.

> 📖 [简体中文文档](README.zh_CN.md) | [English Documentation](README.md)

[![Latest Version](https://camo.githubusercontent.com/34e695c6016bc2a934a96bed696e29b2f2ab562a7134d65a55d00653cd506bea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e302e302d626c75652e737667)](https://github.com/ycookies/filament-nav-manager)[![License](https://camo.githubusercontent.com/8bb50fd2278f18fc326bf71f6e88ca8f884f72f179d3e555e20ed30157190d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e737667)](LICENSE.md)[![PHP Version](https://camo.githubusercontent.com/c5e8da782b1a0673c08b4f474108036d2cc973470eed2d5d89d48e8c8475eee6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e322d626c75652e737667)](https://php.net)[![Filament Version](https://camo.githubusercontent.com/44075bcbe154e1e1f83e429adceb78f639dc5ec5653cb996aec3ca5ad51e4c07/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f66696c616d656e742d253545342e302d6f72616e67652e737667)](https://filamentphp.com)

Features
--------

[](#features)

✨ **Rich Feature Set**

- 🎯 Dynamic navigation management through Filament UI
- 🔄 Automatic synchronization of Filament resources and pages
- 🌳 Tree-structured menu hierarchy support
- 🎨 Customizable navigation groups, icons, and badges
- 🔐 Role-based access control
- 🌍 Multi-language support (English, Simplified Chinese, Traditional Chinese)
- ⚡ Navigation caching for better performance
- 📦 Easy installation and setup

Installation
------------

[](#installation)

You can install the package via Composer:

```
composer require ycookies/filament-nav-manager
```

### Publish and Run Migrations

[](#publish-and-run-migrations)

```
php artisan filament-nav-manager:install
```

This command will:

1. Publish the configuration file
2. Publish migration files
3. Ask if you want to run migrations
4. Allow you to sync panels

Or manually:

```
php artisan vendor:publish --tag="filament-nav-manager-migrations"
php artisan migrate
php artisan vendor:publish --tag="filament-nav-manager-config"
```

Configuration
-------------

[](#configuration)

### Enable the Plugin

[](#enable-the-plugin)

Add the plugin to your Filament panel provider:

```
use Ycookies\FilamentNavManager\FilamentNavManagerPlugin;
use Ycookies\FilamentNavManager\Models\NavManager;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugin(FilamentNavManagerPlugin::make())
        ->navigation(
            NavManager::generate()
                ->panel($panel->getId())
                ->cacheTime(config('nav-manager.cache_seconds', 0))
                ->toClosure()
        );
}
```

### Configure Permissions

[](#configure-permissions)

Edit `config/nav-manager.php`:

```
return [
    // Allow specific roles to access Nav Manager
    'allowed_roles' => ['admin', 'super_admin'], // or null for all authenticated users

    // Cache navigation for better performance (in seconds)
    'cache_seconds' => 3600, // 0 to disable caching

    // Database table name
    'table_name' => 'nav_manager',

    // Navigation group for Nav Manager resource in sidebar
    'navigation_group' => null, // null to use translation, or custom name like 'System', 'Settings'
];
```

### Customize Navigation Group

[](#customize-navigation-group)

You can customize which navigation group the Nav Manager resource appears in:

```
// config/nav-manager.php
return [
    'navigation_group' => 'System Settings', // Custom group name
    // or
    'navigation_group' => null, // Use default translation
];
```

Usage
-----

[](#usage)

### Syncing Filament Resources and Pages

[](#syncing-filament-resources-and-pages)

#### Option 1: Via UI

[](#option-1-via-ui)

1. Navigate to "Navigation Manager" in your Filament panel
2. Click the "Sync Filament Menu" button
3. Confirm the sync operation

#### Option 2: Via Command Line

[](#option-2-via-command-line)

Sync a specific panel:

```
php artisan filament-nav-manager:sync admin
```

Or sync all panels during installation:

```
php artisan filament-nav-manager:install
```

### Managing Navigation Items

[](#managing-navigation-items)

Once installed, you'll see "Navigation Manager" in your Filament navigation. From there you can:

- ✅ Create new navigation items
- ✅ Edit existing items
- ✅ Delete items
- ✅ Reorder items (drag and drop if tree view is enabled)
- ✅ Toggle visibility
- ✅ Manage icons and badges
- ✅ Set permissions

### Navigation Item Types

[](#navigation-item-types)

The package supports several navigation item types:

1. **Group** - A navigation group that can contain child items
2. **Resource** - Links to a Filament resource
3. **Page** - Links to a Filament page
4. **Route** - Links to a Laravel route
5. **URL** - Links to any URL (internal or external)

Navigation Structure
--------------------

[](#navigation-structure)

Navigation items are organized in a hierarchical tree structure:

```
Navigation Group
├── Resource Item
├── Page Item
└── Navigation Group
    ├── Resource Item
    └── Route Item

```

Advanced Usage
--------------

[](#advanced-usage)

### Programmatic Navigation Management

[](#programmatic-navigation-management)

You can also manage navigation programmatically:

```
use Ycookies\FilamentNavManager\Models\NavManager;

// Create a navigation item
NavManager::create([
    'title' => 'My Menu',
    'type' => NavManager::TYPE_RESOURCE,
    'target' => \App\Filament\Resources\Users\UserResource::class,
    'panel' => 'admin',
    'parent_id' => 0,
    'order' => 1,
    'show' => true,
    'icon' => 'heroicon-o-users',
]);

// Sync panel resources and pages
$panel = Filament::getPanel('admin');
$count = NavManager::syncPanel($panel);

// Clear navigation cache
NavManager::flushNavigationCache('admin');
```

### Custom Navigation Generation

[](#custom-navigation-generation)

```
use Ycookies\FilamentNavManager\Models\NavManager;

// Generate navigation for a specific panel
$navigation = NavManager::navigationForPanel('admin', cacheSeconds: 3600);

// Use in panel configuration
$panel->navigation(
    NavManager::generate()
        ->panel('admin')
        ->cacheTime(3600)
        ->toClosure()
);
```

Multi-Language Support
----------------------

[](#multi-language-support)

The package includes translations for:

- 🇬🇧 English (`en`)
- 🇨🇳 Simplified Chinese (`zh_CN`)
- 🇹🇼 Traditional Chinese (`zh_TW`)

Translations are automatically loaded. Set your application locale:

```
config(['app.locale' => 'zh_CN']);
```

Role-Based Access Control
-------------------------

[](#role-based-access-control)

Configure which roles can access the Navigation Manager:

```
// config/nav-manager.php
return [
    'allowed_roles' => ['admin', 'super_admin'],
];
```

If using Spatie Laravel Permission:

```
// The package automatically checks if user has any of the allowed roles
'allowed_roles' => ['admin', 'super_admin'],
```

Set to `null` to allow all authenticated users:

```
'allowed_roles' => null, // All authenticated users can access
```

Tree View Support
-----------------

[](#tree-view-support)

If your application has a `treeView` table macro (commonly used for hierarchical data), the navigation table will automatically use it for a better tree-structured display.

Clearing Navigation Cache
-------------------------

[](#clearing-navigation-cache)

```
use Ycookies\FilamentNavManager\NavManagerNavigationGenerator;

// Clear cache for current panel
NavManagerNavigationGenerator::flush();

// Clear cache for specific panel
NavManagerNavigationGenerator::flush('admin');
```

Or via model:

```
use Ycookies\FilamentNavManager\Models\NavManager;

NavManager::flushNavigationCache('admin');
```

Database Schema
---------------

[](#database-schema)

The package creates a `nav_manager` table with the following structure:

- `id` - Primary key
- `parent_id` - Parent menu item ID (0 for top-level)
- `panel` - Filament panel ID
- `order` - Display order
- `title` - Menu title
- `type` - Menu type (group, resource, page, route, url)
- `icon` - Heroicon name
- `uri` - URI path
- `target` - Resource class, Page class, or route name
- `extension` - Extension identifier
- `show` - Visibility toggle
- `badge` - Badge text
- `badge_color` - Badge color
- `is_collapsed` - Collapsed state
- `permission` - Required permission
- `created_at` / `updated_at` - Timestamps

Commands
--------

[](#commands)

### Install Command

[](#install-command)

```
php artisan filament-nav-manager:install
```

Runs migrations and optionally syncs panels.

### Sync Command

[](#sync-command)

```
php artisan filament-nav-manager:sync {panel}
```

Syncs Filament resources and pages for a specific panel.

Troubleshooting
---------------

[](#troubleshooting)

### Navigation Not Appearing

[](#navigation-not-appearing)

1. Ensure the plugin is registered in your Panel Provider
2. Check that navigation items have `show = true`
3. Verify user has required roles (if configured)
4. Clear navigation cache: `NavManager::flushNavigationCache()`

### Sync Not Working

[](#sync-not-working)

1. Verify the panel ID exists
2. Check that resources/pages are properly registered in the panel
3. Review error logs for specific issues

### Permission Issues

[](#permission-issues)

1. Check `config/nav-manager.php` for `allowed_roles` configuration
2. Verify user roles are correctly assigned
3. Ensure Spatie Laravel Permission is installed if using roles

Requirements
------------

[](#requirements)

- PHP &gt;= 8.2
- Laravel &gt;= 10.0
- Filament &gt;= 4.0

Contributing
------------

[](#contributing)

Contributions are welcome! Please feel free to submit a Pull Request.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

Support
-------

[](#support)

- 📧 Email:
- 🐛 Issues: [GitHub Issues](https://github.com/ycookies/filament-nav-manager/issues)
- 📖 Documentation: [GitHub Wiki](https://github.com/ycookies/filament-nav-manager/wiki)

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

---

**Made with ❤️ by [eRic](https://github.com/ycookies)**

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance82

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 87.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~9 days

Total

7

Last Release

105d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d76fd0d0001fde29ef4273d9ef336f24fdd76b04b5ed9bb264a52ff7f388b95e?d=identicon)[ycookies](/maintainers/ycookies)

---

Top Contributors

[![ycookies](https://avatars.githubusercontent.com/u/20916476?v=4)](https://github.com/ycookies "ycookies (14 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

laravelmenunavigationfilamentfilament-pluginfilamentphpsidebartree-menuadmin-panelfilament-navigationmulti-paneladmin-menuycookiesfilament-nav-managernavigation-managernested-menu

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/ycookies-filament-nav-manager/health.svg)

```
[![Health](https://phpackages.com/badges/ycookies-filament-nav-manager/health.svg)](https://phpackages.com/packages/ycookies-filament-nav-manager)
```

###  Alternatives

[a909m/filament-statefusion

Filament StateFusion is a powerful FilamentPHP plugin that seamlessly integrates Spatie Laravel Model States into the Filament admin panel. This package provides an intuitive way to manage model states, transitions, and filtering within Filament, enhancing the user experience and developer productivity.

3010.8k1](/packages/a909m-filament-statefusion)[relaticle/custom-fields

User Defined Custom Fields for Laravel Filament

15828.6k](/packages/relaticle-custom-fields)[mradder/filament-logger

Audit logging, activity tracking, exports, alerts, and dashboards for Filament admin panels.

141.1k](/packages/mradder-filament-logger)[inerba/filament-db-config

A Filament plugin for database-backed application settings and editable content, with caching and easy page generation.

329.1k](/packages/inerba-filament-db-config)[caresome/filament-neobrutalism-theme

A neobrutalism theme for FilamentPHP admin panels

303.2k](/packages/caresome-filament-neobrutalism-theme)[watheqalshowaiter/filament-sticky-table-header

A Filament plugin that makes table headers stick when scrolling down for better UX.

3020.4k](/packages/watheqalshowaiter-filament-sticky-table-header)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
