A powerful Filament v4 & v5 plugin for managing menus with multiple locations, drag & drop reordering, Eloquent model support, auto-save, and dark theme.
notebrainslab/filament-menu-manager is a Laravel package for a powerful filament v4 & v5 plugin for managing menus with multiple locations, drag & drop reordering, eloquent model support, auto-save, and dark theme..
It currently has 8 GitHub stars and 2.510 downloads on Packagist (latest version 2.0.0).
Install it with composer require notebrainslab/filament-menu-manager.
Discover more Laravel packages by notebrainslab
or browse all Laravel packages to compare alternatives.
Last updated
A powerful Filament v4 & v5 plugin for managing navigation menus with:
| Dependency | Version |
|---|---|
| PHP | ^8.2 |
| Laravel | ^11.0 \| ^12.0 \| ^13.0 |
| Filament | ^4.0 \| ^5.0 |
| Livewire | ^3.0 \| ^4.0 |
composer require notebrainslab/filament-menu-manager
php artisan filament-menu-manager:install
# Or manually:
php artisan vendor:publish --tag="filament-menu-manager-migrations"
php artisan migrate
use NoteBrainsLab\FilamentMenuManager\FilamentMenuManagerPlugin;
public function panel(Panel $panel): Panel
{
return $panel
->plugin(
FilamentMenuManagerPlugin::make()
->locations([
'primary' => 'Primary',
'footer' => 'Footer',
])
);
}
If you are upgrading from v1.0, run the following commands to install the latest version and publish the updated configuration file.
composer require notebrainslab/filament-menu-manager:^2.0
php artisan vendor:publish --tag="filament-menu-manager-config" --force
The
--forceflag will overwrite your existing configuration file with the latest v2.0 version.
Publish the config file (Optional):
php artisan vendor:publish --tag="filament-menu-manager-config"
Publish the resource files (Optional):
php artisan vendor:publish --tag="filament-menu-manager-views"
FilamentMenuManagerPlugin::make()
->locations([
'primary' => 'Primary',
'footer' => 'Footer',
])
->modelSources([
\App\Models\Post::class,
\App\Models\Page::class,
])
->navigationGroup('Content')
->navigationIcon('heroicon-o-bars-3')
->navigationSort(10)
->navigationLabel('Menus')
->authentication(function () {
return auth()->user()->can('View:MenuManagerPage');
// Expected boolean value: true or false
// Based on your permission matrix
}),
To make an Eloquent model selectable in the Models panel, add the trait:
use NoteBrainsLab\FilamentMenuManager\Concerns\HasMenuItems;
class Post extends Model
{
use HasMenuItems;
// Optional: override the defaults
public function getMenuLabel(): string
{
return $this->title;
}
public function getMenuUrl(): string
{
return route('posts.show', $this);
}
public function getMenuTarget(): string
{
return '_self';
}
public function getMenuIcon(): ?string
{
return 'heroicon-o-document';
}
}
Then register the model in the plugin:
FilamentMenuManagerPlugin::make()
->modelSources([
\App\Models\Post::class,
])
@php
$manager = app(\NoteBrainsLab\FilamentMenuManager\MenuManager::class);
$menus = $manager->menusForLocation('primary');
$menu = $menus->first();
$tree = $menu?->getTree() ?? [];
@endphp
@foreach($tree as $item)
<a href="{{ $item['url'] }}"
target="{{ $item['target'] }}">
{{ $item['title'] }}
</a>
@if(!empty($item['children']))
{{-- Render child items --}}
@endif
@endforeach
composer test
See CHANGELOG.md.
MIT License. See LICENSE.