PHPackages                             pistacchioweb/filament-menu-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. pistacchioweb/filament-menu-manager

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

pistacchioweb/filament-menu-manager
===================================

A package to create and manage application menus through Filament

v0.0.4(7mo ago)01MITPHPPHP ^8.2

Since Sep 24Pushed 7mo agoCompare

[ Source](https://github.com/PistacchioWeb/filament-menu-manager)[ Packagist](https://packagist.org/packages/pistacchioweb/filament-menu-manager)[ RSS](/packages/pistacchioweb-filament-menu-manager/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (5)Used By (0)

Filament Menu Manager
=====================

[](#filament-menu-manager)

Fork of . We decided to fork this repository to allow our projects to upgrade to filament V4.

Note

Not production ready, use it at your own risk.

This [Filament](https://filamentphp.com) package allows you to create and manage menus in your Filament application.

[![Filament Menu Manager](https://github.com/pistacchioweb/filament-menu-manager/raw/main/art/menu-manager.jpg)](https://github.com/pistacchioweb/filament-menu-manager/raw/main/art/menu-manager.jpg)

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

[](#installation)

You need to publish the migrations and run them:

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

You can publish the config file with:

```
php artisan vendor:publish --tag="filament-menu-manager-config"
```

Optionally, if you want to customize the views, you can publish them with:

```
php artisan vendor:publish --tag="filament-menu-manager-views"
```

This is the contents of the published config file:

```
return [
    'tables' => [
        'menus' => 'menus',
        'menu_items' => 'menu_items',
        'menu_locations' => 'menu_locations',
    ],
];
```

Add the plugin to `AdminPanelProvider`:

```
use PistacchioWeb\FilamentMenuManager\FilamentMenuManagerPlugin;

$panel
    ...
    ->plugin(FilamentMenuManagerPlugin::make())
```

Usage
-----

[](#usage)

### Adding locations

[](#adding-locations)

Locations are the places where you can display menus in the frontend. You can add locations in the `AdminPanelProvider`:

```
use PistacchioWeb\FilamentMenuManager\FilamentMenuManagerPlugin;

$panel
    ...
    ->plugin(
        FilamentMenuManagerPlugin::make()
            ->addLocation('header', 'Header')
            ->addLocation('footer', 'Footer')
    )
```

The first argument is the key of the location, and the second argument is the title of the location.

Alternatively, you may add locations using an array:

```
use PistacchioWeb\FilamentMenuManager\FilamentMenuManagerPlugin;

$panel
    ...
    ->plugin(
        FilamentMenuManagerPlugin::make()
            ->addLocations([
                'header' => 'Header',
                'footer' => 'Footer',
            ])
    )
```

### Setting up Menu Panels

[](#setting-up-menu-panels)

Menu panels are the panels that contain the menu items which you can add to the menus.

#### Custom Link Menu Panel

[](#custom-link-menu-panel)

By default, the package provides a **Custom Link** menu panel that allows you to add custom links to the menus.

[![Custom Link Menu Panel](https://github.com/pistacchioweb/filament-menu-manager/raw/main/art/custom-link.png)](https://github.com/pistacchioweb/filament-menu-manager/raw/main/art/custom-link.png)

The panel can be disabled by using the following when configuring the plugin, should you not need this functionality.

```
use PistacchioWeb\FilamentMenuManager\FilamentMenuManagerPlugin;

$panel
    ...
    ->plugin(
        FilamentMenuManagerPlugin::make()
            ->showCustomLinkPanel(false)
    )
```

#### Custom Text Menu Panel

[](#custom-text-menu-panel)

This package provides a **Custom Text** menu panel that allows you to add custom text items to the menus.

It is identical to the **Custom Link** menu panel except for the fact that you only set a title without a URL or target. This can be useful to add headers to mega-style menus.

The panel is disabled by default to prevent visual clutter. To enable the Custom Text menu panel, you can use the following when configuring the plugin.

```
use PistacchioWeb\FilamentMenuManager\FilamentMenuManagerPlugin;

$panel
    ...
    ->plugin(
        FilamentMenuManagerPlugin::make()
            ->showCustomTextPanel()
    )
```

#### Static Menu Panel

[](#static-menu-panel)

The static menu panel allows you to add menu items manually.

```
use PistacchioWeb\FilamentMenuManager\FilamentMenuManagerPlugin;
use PistacchioWeb\FilamentMenuManager\MenuPanel\StaticMenuPanel;

$panel
    ...
    ->plugin(
        FilamentMenuManagerPlugin::make()
            ->addMenuPanels([
                StaticMenuPanel::make()
                    ->add('Home', url('/'))
                    ->add('Blog', url('/blog')),
            ])
    )
```

Similarily to locations, you may also add static menu items using an array:

```
use PistacchioWeb\FilamentMenuManager\FilamentMenuManagerPlugin;
use PistacchioWeb\FilamentMenuManager\MenuPanel\StaticMenuPanel;

$panel
    ...
    ->plugin(
        FilamentMenuManagerPlugin::make()
            ->addMenuPanels([
                StaticMenuPanel::make()
                    ->addMany([
                        'Home' => url('/'),
                        'Blog' => url('/blog'),
                    ])
            ])
    )
```

[![Static Menu Panel](https://github.com/pistacchioweb/filament-menu-manager/raw/main/art/static-menu.png)](https://github.com/pistacchioweb/filament-menu-manager/raw/main/art/static-menu.png)

#### Model Menu Panel

[](#model-menu-panel)

The model menu panel allows you to add menu items from a model.

To create a model menu panel, your model must implement the `\PistacchioWeb\FilamentMenuManager\Contracts\MenuPanelable` interface and `\PistacchioWeb\FilamentMenuManager\Concerns\HasMenuPanel` trait.

Then you must also implement the `getMenuPanelTitleColumn` and `getMenuPanelUrlUsing` methods. A complete example of this implementation is as follows:

```
use PistacchioWeb\FilamentMenuManager\Concerns\HasMenuPanel;
use PistacchioWeb\FilamentMenuManager\Contracts\MenuPanelable;
use Illuminate\Database\Eloquent\Model;

class Category extends Model implements MenuPanelable
{
    use HasMenuPanel;

    public function getMenuPanelTitleColumn(): string
    {
        return 'name';
    }

    public function getMenuPanelUrlUsing(): callable
    {
        return fn (self $model) => route('categories.show', $model->slug);
    }
}
```

Then you can add the model menu panel to the plugin:

```
use PistacchioWeb\FilamentMenuManager\FilamentMenuManagerPlugin;
use PistacchioWeb\FilamentMenuManager\MenuPanel\ModelMenuPanel;

$panel
    ...
    ->plugin(
        FilamentMenuManagerPlugin::make()
            ->addMenuPanels([
                ModelMenuPanel::make()
                    ->model(\App\Models\Category::class),
            ])
    )
```

[![Model Menu Panel](https://github.com/pistacchioweb/filament-menu-manager/raw/main/art/model-menu.png)](https://github.com/pistacchioweb/filament-menu-manager/raw/main/art/model-menu.png)

#### Additional Menu Panel Options

[](#additional-menu-panel-options)

When registering a menu panel, multiple methods are available allowing you to configure the panel's behavior such as collapse state and pagination.

```
use PistacchioWeb\FilamentMenuManager\FilamentMenuManagerPlugin;
use PistacchioWeb\FilamentMenuManager\MenuPanel\StaticMenuPanel;

$panel
    ...
    ->plugin(
        FilamentMenuManagerPlugin::make()
            ->addMenuPanels([
                StaticMenuPanel::make()
                    ->addMany([
                        ...
                    ])
                    ->description('Lorem ipsum...')
                    ->icon('heroicon-m-link')
                    ->collapsed(true)
                    ->collapsible(true)
                    ->paginate(perPage: 5, condition: true)
            ])
    )
```

### Custom Fields

[](#custom-fields)

In some cases, you may want to extend menu and menu items with custom fields. To do this, start by passing an array of form components to the `addMenuFields` and `addMenuItemFields` methods when registering the plugin:

```
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Toggle;
use PistacchioWeb\FilamentMenuManager\FilamentMenuManagerPlugin;

$panel
    ...
    ->plugin(
        FilamentMenuManagerPlugin::make()
            ->addMenuFields([
                Toggle::make('is_logged_in'),
            ])
            ->addMenuItemFields([
                TextInput::make('classes'),
            ])
    )
```

Next, create a migration adding the additional columns to the appropriate tables:

```
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::table(config('filament-menu-manager.tables.menus'), function (Blueprint $table) {
            $table->boolean('is_logged_in')->default(false);
        });

        Schema::table(config('filament-menu-manager.tables.menu_items'), function (Blueprint $table) {
            $table->string('classes')->nullable();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table(config('filament-menu-manager.tables.menus'), function (Blueprint $table) {
            $table->dropColumn('is_logged_in');
        });

        Schema::table(config('filament-menu-manager.tables.menu_items'), function (Blueprint $table) {
            $table->dropColumn('classes');
        });
    }
}
```

Once done, simply run `php artisan migrate`.

### Customizing the Resource

[](#customizing-the-resource)

Out of the box, a default Menu Resource is registered with Filament when registering the plugin in the admin provider. This resource can be extended and overridden allowing for more fine-grained control.

Start by extending the `PistacchioWeb\FilamentMenuManager\Resources\MenuResource` class in your application. Below is an example:

```
namespace App\Filament\Plugins\Resources;

use PistacchioWeb\FilamentMenuManager\Resources\MenuResource as BaseMenuResource;

class MenuResource extends BaseMenuResource
{
    protected static ?string $navigationGroup = 'Navigation';

    public static function getNavigationBadge(): ?string
    {
        return number_format(static::getModel()::count());
    }
}
```

Now pass the custom resource to `usingResource` while registering the plugin with the panel:

```
use App\Filament\Plugins\Resources\MenuResource;
use PistacchioWeb\FilamentMenuManager\FilamentMenuManagerPlugin;

$panel
    ...
    ->plugin(
        FilamentMenuManagerPlugin::make()
            ->usingResource(MenuResource::class)
    )
```

### Customizing the Models

[](#customizing-the-models)

The default models used by the plugin can be configured and overridden similarly to the plugin resource as seen above.

Simply extend the default models and then pass the classes when registering the plugin in the panel:

```
use App\Models\Menu;
use App\Models\MenuItem;
use App\Models\MenuLocation;
use PistacchioWeb\FilamentMenuManager\FilamentMenuManagerPlugin;

$panel
    ...
    ->plugin(
        FilamentMenuManagerPlugin::make()
            ->usingMenuModel(Menu::class)
            ->usingMenuItemModel(MenuItem::class)
            ->usingMenuLocationModel(MenuLocation::class)
    )
```

### Using Menus

[](#using-menus)

Getting the assigned menu for a registered location can be done using the `Menu` model. Below we will call the menu assigned to the `primary` location:

```
use PistacchioWeb\FilamentMenuManager\Models\Menu;

$menu = Menu::location('primary');
```

Menu items can be iterated from the `menuItems` relationship:

```
@foreach ($menu->menuItems as $item)
    {{ $item->title }}
@endforeach
```

When a menu item is a parent, a collection of the child menu items will be available on the `children` property:

```
@foreach ($menu->menuItems as $item)
    {{ $item->title }}

    @if ($item->children)
        @foreach ($item->children as $child)
            {{ $child->title }}
        @endforeach
    @endif
@endforeach
```

### Configuring Indent/Unindent Actions

[](#configuring-indentunindent-actions)

The package includes indent and unindent buttons that provide an alternative to drag-and-drop for organizing menu hierarchy. This feature is enabled by default but can be configured:

```
use PistacchioWeb\FilamentMenuManager\FilamentMenuManagerPlugin;

$panel
    ...
    ->plugin(
        FilamentMenuManagerPlugin::make()
            ->enableIndentActions(false) // Disable
    )
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](https://github.com/pistacchioweb/filament-menu-manager/raw/main/CHANGELOG.md) for more information on what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](https://github.com/pistacchioweb/filament-menu-manager/raw/main/.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](https://github.com/pistacchioweb/filament-menu-manager/security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Ngo Quoc Dat](https://github.com/pistacchioweb)
- [Log1x](https://github.com/Log1x)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](https://github.com/pistacchioweb/filament-menu-manager/raw/main/LICENSE.md) for more information.

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance64

Regular maintenance activity

Popularity1

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

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 ~4 days

Total

4

Last Release

218d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8a36a2e56dff344b3140a13555156184137ca341f56ba181f9b7d658e180649e?d=identicon)[PistacchioWeb](/maintainers/PistacchioWeb)

### Embed Badge

![Health badge](/badges/pistacchioweb-filament-menu-manager/health.svg)

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

###  Alternatives

[guava/calendar

Adds support for vkurko/calendar to Filament PHP.

298241.0k3](/packages/guava-calendar)[datlechin/filament-menu-builder

Create and manage menus and menu items

13550.3k2](/packages/datlechin-filament-menu-builder)[marcelweidum/filament-expiration-notice

Customize the livewire expiration notice

9169.0k4](/packages/marcelweidum-filament-expiration-notice)[swisnl/filament-backgrounds

Beautiful backgrounds for Filament auth pages

54149.2k6](/packages/swisnl-filament-backgrounds)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)[codewithdennis/filament-lucide-icons

A Filament plugin that integrates Lucide icons, allowing you to use them seamlessly across Filament forms, tables, actions, and more.

4529.4k2](/packages/codewithdennis-filament-lucide-icons)

PHPackages © 2026

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