PHPackages                             aflorea4/filament-navigation - 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. aflorea4/filament-navigation

ActiveLibrary

aflorea4/filament-navigation
============================

Build structured navigation menus in Filament.

v2.0.8(3mo ago)012MITPHPPHP ^8.2

Since Jan 26Pushed 3mo agoCompare

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

READMEChangelogDependencies (15)Versions (10)Used By (0)

Build structured navigation menus in Filament.
==============================================

[](#build-structured-navigation-menus-in-filament)

This plugin for Filament provides a `Navigation` resource that lets you build structural navigation menus with a clean drag-and-drop UI.

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

[](#requirements)

- PHP 8.2 or higher
- Laravel 11.0 or 12.0
- Filament 4.0

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

[](#installation)

Begin by installing this package via Composer:

```
composer require aflorea4/filament-navigation
```

Run migrations.

```
php artisan migrate
```

Publish the package's assets:

```
php artisan filament:assets
```

Usage
-----

[](#usage)

You first need to register the plugin with Filament. This can be done inside of your `PanelProvider`, e.g. `AdminPanelProvider`.

```
use Aflorea4\FilamentNavigation\FilamentNavigation;

return $panel
    ->plugin(FilamentNavigation::make());
```

If you wish to customise the navigation group, sort or icon, you can use the `NavigationResource::navigationGroup()`, `NavigationResource::navigationSort()` and `NavigationResource::navigationIcon()` methods.

### Data structure

[](#data-structure)

Each navigation menu is required to have a `name` and `handle`. The `handle` should be unique and used to retrieve the menu.

Items are stored inside of a JSON column called `items`. This is a recursive data structure that looks like:

```
[
    {
        "label": "Home",
        "type": "external-link",
        "data": {
            "url": "/",
            "target": "_blank",
        },
        "children": [
            // ...
        ],
    }
]
```

The recursive structure makes it really simple to render nested menus / dropdowns:

```

    @foreach($menu->items as $item)

            {{ $item['label'] }}

            @if($item['children'])

                    {{-- Render the item's children here... --}}

            @endif

    @endforeach

```

### Retrieving a navigation object

[](#retrieving-a-navigation-object)

To retrieve a navigation object, provide the handle to the `Aflorea4\FilamentNavigation\Models\Navigation::fromHandle()` method.

```
use Aflorea4\FilamentNavigation\Models\Navigation;

$menu = Navigation::fromHandle('main-menu');
```

### Custom item types

[](#custom-item-types)

Out of the box, this plugin comes with a single "item type" called "External link". This item type expects a URL to be provided and an optional "target" (same tab or new tab).

It's possible to extend the plugin with custom item types. Custom item types have a name and an array of Filament field objects (or a `Closure` that produces an array) that will be displayed inside of the "Item" modal.

This API allows you to deeply integrate navigation menus with your application's own entities and models.

```
return $panel
    ->plugin(
        FilamentNavigation::make()
            ->itemType('post', [
                Select::make('post_id')
                    ->//...
            ])
    );
```

All custom fields for the item type can be found inside of the `data` property on the item.

### Global custom fields

[](#global-custom-fields)

There might be cases where you want all item types to have an additional set of fields. This is useful for classes, custom IDs and more.

To register global custom fields, use the `withExtraFields()` method on the plugin object.

```
return $panel
    ->plugin(
        FilamentNavigation::make()
            ->withExtraFields([
                TextInput::make('classes'),
            ]),
    );
```

### The `Navigation` field type

[](#the-navigation-field-type)

This plugin also provides a custom Filament field that can be used to search and select a navigation menu inside other forms and resources.

```
use Aflorea4\FilamentNavigation\Filament\Fields\NavigationSelect;

->schema([
    NavigationSelect::make('navigation_id'),
])
```

By default, this field will not be searchable and the value for each option will be the menu `id`.

To make the field searchable, call the `->searchable()` method.

```
->schema([
    NavigationSelect::make('navigation_id')
        ->searchable(),
])
```

If you wish to change the value for each option, call the `->optionValue()` method.

```
->schema([
    NavigationSelect::make('navigation_id')
        ->optionValue('handle'),
])
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

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

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

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

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

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Alexandru Florea](https://github.com/aflorea4) - Current Maintainer
- [Ryan Chandler](https://github.com/ryangjchandler) - Original Author
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance82

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 56.7% 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 ~1 days

Total

9

Last Release

94d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/315d245e8480aa5b196fe359fad15855c654ee30f77eb7918bc0fbc6b72070e3?d=identicon)[aflorea4](/maintainers/aflorea4)

---

Top Contributors

[![ryangjchandler](https://avatars.githubusercontent.com/u/41837763?v=4)](https://github.com/ryangjchandler "ryangjchandler (68 commits)")[![aflorea4](https://avatars.githubusercontent.com/u/5405865?v=4)](https://github.com/aflorea4 "aflorea4 (10 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (8 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (8 commits)")[![howdu](https://avatars.githubusercontent.com/u/533658?v=4)](https://github.com/howdu "howdu (2 commits)")[![blackmunk](https://avatars.githubusercontent.com/u/30363767?v=4)](https://github.com/blackmunk "blackmunk (2 commits)")[![bumbummen99](https://avatars.githubusercontent.com/u/4533331?v=4)](https://github.com/bumbummen99 "bumbummen99 (2 commits)")[![danielbehrendt](https://avatars.githubusercontent.com/u/283437?v=4)](https://github.com/danielbehrendt "danielbehrendt (2 commits)")[![dood-](https://avatars.githubusercontent.com/u/10099592?v=4)](https://github.com/dood- "dood- (1 commits)")[![FDT2k](https://avatars.githubusercontent.com/u/5261645?v=4)](https://github.com/FDT2k "FDT2k (1 commits)")[![flxsource](https://avatars.githubusercontent.com/u/1785446?v=4)](https://github.com/flxsource "flxsource (1 commits)")[![digitall-it](https://avatars.githubusercontent.com/u/3578378?v=4)](https://github.com/digitall-it "digitall-it (1 commits)")[![happytodev](https://avatars.githubusercontent.com/u/425998?v=4)](https://github.com/happytodev "happytodev (1 commits)")[![devmatheus](https://avatars.githubusercontent.com/u/3445672?v=4)](https://github.com/devmatheus "devmatheus (1 commits)")[![ihahachi](https://avatars.githubusercontent.com/u/7762172?v=4)](https://github.com/ihahachi "ihahachi (1 commits)")[![justrau](https://avatars.githubusercontent.com/u/10882793?v=4)](https://github.com/justrau "justrau (1 commits)")[![koupisbean](https://avatars.githubusercontent.com/u/44702609?v=4)](https://github.com/koupisbean "koupisbean (1 commits)")[![Kristories](https://avatars.githubusercontent.com/u/774338?v=4)](https://github.com/Kristories "Kristories (1 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (1 commits)")[![lordjoo](https://avatars.githubusercontent.com/u/11289152?v=4)](https://github.com/lordjoo "lordjoo (1 commits)")

---

Tags

laravelfilament-navigationaflorea4

###  Code Quality

TestsPest

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/aflorea4-filament-navigation/health.svg)

```
[![Health](https://phpackages.com/badges/aflorea4-filament-navigation/health.svg)](https://phpackages.com/packages/aflorea4-filament-navigation)
```

###  Alternatives

[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[guava/calendar

Adds support for vkurko/calendar to Filament PHP.

298241.0k3](/packages/guava-calendar)[guava/filament-knowledge-base

A filament plugin that adds a knowledge base and help to your filament panel(s).

206120.5k1](/packages/guava-filament-knowledge-base)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[bezhansalleh/filament-plugin-essentials

A collection of essential traits that streamline Filament plugin development by taking care of the boilerplate, so you can focus on shipping real features faster

27584.7k16](/packages/bezhansalleh-filament-plugin-essentials)[guava/filament-modal-relation-managers

Allows you to embed relation managers inside filament modals.

7565.0k4](/packages/guava-filament-modal-relation-managers)

PHPackages © 2026

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