PHPackages                             blimundo/laravel-menu - 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. blimundo/laravel-menu

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

blimundo/laravel-menu
=====================

menu management for Laravel applications

2.0.0(4y ago)142[1 issues](https://github.com/blimundo/laravel-menu/issues)MITPHP

Since Jun 17Pushed 4y ago1 watchersCompare

[ Source](https://github.com/blimundo/laravel-menu)[ Packagist](https://packagist.org/packages/blimundo/laravel-menu)[ RSS](/packages/blimundo-laravel-menu/feed)WikiDiscussions main Synced 2d ago

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

Menu management for Laravel applications
========================================

[](#menu-management-for-laravel-applications)

Menu management in Laravel made simple and painless. This package does not provide any UI, focusing only on functionality to store and display the menu.

Items can be displayed in different languages thanks to the [spatie/laravel-translatable](https://github.com/spatie/laravel-translatable) package.

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

[](#requirements)

This package requires Laravel 8 or higher, PHP 8 or higher, and a database that supports json fields and MySQL compatible functions.

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

[](#installation)

You can install the package via composer:

```
composer require blimundo/laravel-menu

```

The package will automatically register itself.

After install you can create the menus table by running the migrations:

```
php artisan migrate

```

A MenuGenerator alias will be available to application.

Example
-------

[](#example)

```
use Blimundo\Menu\Builder;

Builder::add('Home')->order(1)->icon('mdi mdi-home')->url('HomeController@show')->create();

Builder::add(['en'  =>  'Settings',  'pt'  =>  'Configurações'])
	->order(9)
	->icon('mdi mdi-cog')
	->items(function  ()  {
		Builder::add(['en'  =>  'Roles',  'pt'  =>  'Funções'])
		->order(1)
		->icon('mdi mdi-account-group')
		->url('role.index')
		->gates('can_view_roles')
		->create();

		Builder::add(['en'  =>  'Users',  'pt'  =>  'Utilizadores'])
		->order(2)
		->icon('mdi mdi-account')
		->url('user.index')
		->gates('can_view_users')
		->create();
	});

dd(MenuGenerator::generate());

/* Result:

array:2 [
  "Home" => array:5 [
    "icon" => "mdi mdi-home"
    "label" => "Home"
    "link" => "localhost:8000/home"
    "level" => 1
    "has_items" => false
  ]
  "Settings" => array:6 [
    "icon" => "mdi mdi-cog"
    "label" => "Settings"
    "link" => "#"
    "level" => 1
    "has_items" => true
    "items" => array:2 [
      "Roles" => array:5 [
        "icon" => "mdi mdi-account-group"
        "label" => "Roles"
        "link" => "localhost:8000/role"
        "level" => 2
        "has_items" => false
      ]
      "Users" => array:5 [
        "icon" => "mdi mdi-account"
        "label" => "Users"
        "link" => "localhost:8000/user"
        "level" => 2
        "has_items" => false
      ]
    ]
  ]
*/
```

Persisting the menu in the database
-----------------------------------

[](#persisting-the-menu-in-the-database)

To create and persist the menu in the database, you can use the Builder class. In the example below, two menu entries are created:

```
use Blimundo\Menu\Builder;

Builder::add('Home')->create();
Builder::add('Help')->create();
```

#### Translations

[](#translations)

To define multiple languages, just pass an array to the add() method, where the key is the language code. Internally the package uses [spatie/laravel-translatable](https://github.com/spatie/laravel-translatable) to manage translations.

```
Builder::add(['en' => 'Help', 'pt' => 'Ajuda'])->create();
```

#### Url

[](#url)

You have 3 options to generate urls:

- route url (call Laravel route() helper - will rise exception in runtime if route doesn't exist)
- action url (call Laravel action() helper - will rise exeption in runtime if controller or method doesn't exist)
- static url

```
Builder::add('Google')->url('https://google.com')->create();
Builder::add('Add User')->route('users.create')->create();
Builder::add('Import User')->action('\App\Http\Controllers\UserController@import')->create();
```

#### Icon

[](#icon)

To associate an icon to the menu just call the icon() function

```
Builder::add('Help')->icon('mdi mdi-help')->create();
```

#### Order

[](#order)

To set the item order just call the order() function.

```
Builder::add('Help')->order(2)->create();
```

Items with the same order (or that have no defined order) are sorted alphabetically according to the current language.

#### Gates

[](#gates)

Sometimes we want the menu to appear only if the user has certain permissions. This package makes this a breeze. Just call the gates() function with the name of the gate. When generating the menu, the package tests the gate and if it passes the menu is included.

```
Builder::add('Add User')->gates('can_add_user')->create();
```

If you need to test more than one gate, just pass a list. The menu is only displayed if all gates return true.

```
Builder::add('Add User')->gates('can_add_user', 'can_import_user')->create();
```

#### Submenu

[](#submenu)

To create a submenu call the items() function, passing a callback. All menus created within the callback will be associated with the menu.

```
Builder::add('Settings')->items(function  ()  {
	Builder::add('Roles')->create();
	Builder::add('Users')->create();
});
```

License
-------

[](#license)

The Laravel Menu is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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

Total

2

Last Release

1526d ago

Major Versions

1.0.0 → 2.0.02022-03-09

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/43821095?v=4)[Rolando Sanches](/maintainers/Blimundo)[@blimundo](https://github.com/blimundo)

---

Top Contributors

[![blimundo](https://avatars.githubusercontent.com/u/43821095?v=4)](https://github.com/blimundo "blimundo (2 commits)")

### Embed Badge

![Health badge](/badges/blimundo-laravel-menu/health.svg)

```
[![Health](https://phpackages.com/badges/blimundo-laravel-menu/health.svg)](https://phpackages.com/packages/blimundo-laravel-menu)
```

###  Alternatives

[kongulov/nova-tab-translatable

Making Nova Tab Translatable

8559.5k2](/packages/kongulov-nova-tab-translatable)

PHPackages © 2026

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