PHPackages                             jrbconsulting/filament-menu-builder - 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. jrbconsulting/filament-menu-builder

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

jrbconsulting/filament-menu-builder
===================================

Filament(v5) Menu Builder - A reusable hierarchical menu builder for Filament v5

v1.0.2(4mo ago)34AGPL-3.0-or-laterPHPPHP ^8.1

Since Feb 11Pushed 4mo agoCompare

[ Source](https://github.com/jrbconsulting/filament-menu-builder)[ Packagist](https://packagist.org/packages/jrbconsulting/filament-menu-builder)[ Docs](https://github.com/jrbconsulting/filament-menu-builder)[ RSS](/packages/jrbconsulting-filament-menu-builder/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (1)Versions (4)Used By (0)

 [![Filament(v5) Menu Builder](filament-menu-builder_logo.png)](filament-menu-builder_logo.png)

Filament(v5) Menu Builder
=========================

[](#filamentv5-menu-builder)

 A powerful, hierarchical menu builder for **Filament v5** with drag-and-drop reordering, icon support, and tenant-aware architecture.

 [Features](#features) • [Requirements](#requirements) • [Installation](#installation) • [Usage](#usage) • [Configuration](#configuration)

---

✨ Features
----------

[](#-features)

- **🌳 Hierarchical Menus** — Create unlimited parent/child menu levels
- **🔄 Smart Reordering** — Up/down arrows and automatic order conflict resolution
- **🎨 Icon Support** — Built-in Heroicon selector with emoji previews
- **🔗 Flexible Links** — Internal routes or external URLs with target control
- **🏢 Tenant-Aware** — Optional multi-tenant support via `stancl/tenancy`
- **⚡ Performance** — Optional caching for menu tree rendering
- **📱 Mobile-Ready** — Responsive Blade components for frontend rendering
- **🛡️ Auto-Correction** — Duplicate order detection automatically assigns next available position

---

📋 Requirements
--------------

[](#-requirements)

RequirementVersionPHP^8.1Laravel^10.0 | ^11.0 | ^12.0Filament^5.0DatabaseMySQL, PostgreSQL, SQLite, or SQL Server**Optional Dependencies:**

- `stancl/tenancy` — for multi-tenant support
- `spatie/laravel-permission` — for role-based menu access (via Filament Shield)

---

🚀 Installation
--------------

[](#-installation)

```
composer require jrbconsulting/filament-menu-builder
```

### 1. Publish the configuration

[](#1-publish-the-configuration)

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

### 2. Publish and run migrations

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

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

### 3. Publish views (optional)

[](#3-publish-views-optional)

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

### 4. Register the resource (if not auto-discovered)

[](#4-register-the-resource-if-not-auto-discovered)

Add to your `AdminPanelProvider`:

```
use Vendor\FilamentMenuBuilder\Resources\MenuResource;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->resources([
            MenuResource::class,
            // ...
        ]);
}
```

---

📖 Usage
-------

[](#-usage)

### Admin Panel

[](#admin-panel)

Navigate to **Menus** in your Filament admin panel at `/admin/menus`.

#### Creating Menus

[](#creating-menus)

1. Click **Create Menu**
2. Enter menu name
3. Select parent (optional) for hierarchical structure
4. Set order number (auto-corrects on conflict)
5. Choose an icon from the selector
6. Set URL (internal `/path` or external `https://...`)
7. Toggle active status

#### Reordering

[](#reordering)

- Use **↑** and **↓** arrows in the table to move items
- Reordering automatically shifts conflicting items
- Duplicate orders are auto-corrected on save

### Frontend Rendering

[](#frontend-rendering)

#### Blade Component

[](#blade-component)

```
{{-- Render all root menus --}}

{{-- Render specific parent menu --}}

{{-- With custom styling --}}

```

#### Manual Rendering

[](#manual-rendering)

```
@php
$menus = \Vendor\FilamentMenuBuilder\Models\Menu::getTree();
@endphp

@include('filament-menu-builder::components.menu', [
    'menus' => $menus
])
```

#### Eloquent Queries

[](#eloquent-queries)

```
// Get all active menus as tree
$menuTree = \Vendor\FilamentMenuBuilder\Models\Menu::getTree();

// Get root menus only
$rootMenus = \Vendor\FilamentMenuBuilder\Models\Menu::root()->active()->get();

// Get children of specific parent
$submenus = \Vendor\FilamentMenuBuilder\Models\Menu::where('parent_id', $parentId)->get();

// Get menu with depth calculation
$menu = \Vendor\FilamentMenuBuilder\Models\Menu::find(1);
$depth = $menu->calculateDepth(); // Number of ancestors
```

---

⚙️ Configuration
----------------

[](#️-configuration)

Edit `config/filament-menu-builder.php`:

```
return [
    // Model class used for menus
    'model' => \Vendor\FilamentMenuBuilder\Models\Menu::class,

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

    // Enable multi-tenant mode
    'tenant_aware' => false,

    // Enable menu tree caching
    'cache_enabled' => true,

    // Cache duration in seconds
    'cache_duration' => 3600,
];
```

### Tenant-Aware Setup

[](#tenant-aware-setup)

Enable `tenant_aware` in config, then add to your tenant migration:

```
Schema::create('menus', function (Blueprint $table) {
    $table->id();
    $table->foreignId('tenant_id')->constrained(); // Add tenant relation
    $table->foreignId('parent_id')->nullable()->constrained('menus');
    $table->string('name');
    $table->string('url')->nullable();
    $table->string('target', 20)->nullable();
    $table->string('icon')->nullable();
    $table->integer('order')->default(0);
    $table->boolean('is_active')->default(true);
    $table->boolean('is_external')->default(false);
    $table->timestamps();
});
```

---

🏗️ Database Schema
------------------

[](#️-database-schema)

ColumnTypeDescription`id`bigintPrimary key`parent_id`bigint nullableForeign key to parent menu`name`stringMenu item label`url`string nullableLink URL or route`target`string nullableLink target (`_blank`, etc.)`icon`string nullableHeroicon name`order`integerSort position within parent`is_active`booleanVisibility toggle`is_external`booleanExternal link flag---

🎨 Customisation
---------------

[](#-customisation)

### Custom Icons

[](#custom-icons)

Override the icon options in your service provider:

```
use Vendor\FilamentMenuBuilder\Resources\MenuResource;

MenuResource::setIcons([
    'custom-icon' => 'Custom Label',
    'heroicon-o-star' => 'Star',
]);
```

### Custom Blade Views

[](#custom-blade-views)

Publish views and modify:

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

Edit `resources/views/vendor/filament-menu-builder/components/menu.blade.php`

---

🧪 Testing
---------

[](#-testing)

```
composer test
```

---

🤝 Contributing
--------------

[](#-contributing)

Contributions welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details.

---

📄 Licence
---------

[](#-licence)

**GNU Affero General Public Licence v3.0 (AGPL-3.0)**

If you use this software in a network service (SaaS), you must provide source code to users. See [LICENCE](LICENCE) for details.

Commercial licensing available upon request — contact the copyright holder for details.

---

 Built with ❤️ for the Filament community

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance74

Regular maintenance activity

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

3

Last Release

142d ago

### Community

Maintainers

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

---

Top Contributors

[![jrbconsulting-joel](https://avatars.githubusercontent.com/u/142711651?v=4)](https://github.com/jrbconsulting-joel "jrbconsulting-joel (1 commits)")

---

Tags

laravelmenunavigationfilamenthierarchicalfilament-v5

### Embed Badge

![Health badge](/badges/jrbconsulting-filament-menu-builder/health.svg)

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

###  Alternatives

[ysfkaya/filament-phone-input

A phone input component for Laravel Filament

3161.3M25](/packages/ysfkaya-filament-phone-input)[dotswan/filament-map-picker

Easily pick and retrieve geo-coordinates using a map-based interface in your Filament applications.

128192.3k3](/packages/dotswan-filament-map-picker)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[wsmallnews/filament-nestedset

Filament nestedset tree builder powered by kalnoy/nestedset with Filament v4 and v5 support

197.8k19](/packages/wsmallnews-filament-nestedset)[tapp/filament-form-builder

User facing form builder using Filament components

132.4k3](/packages/tapp-filament-form-builder)[devletes/filament-pinnable-navigation

Pinnable navigation support for Filament 5 panels.

121.6k](/packages/devletes-filament-pinnable-navigation)

PHPackages © 2026

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