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

ActiveLibrary

jminayat/laravel-menu
=====================

Menu management for Laravel

v1.0.3(8y ago)020MITPHP

Since Jan 4Pushed 8y agoCompare

[ Source](https://github.com/JMinayaT/laravel-menu)[ Packagist](https://packagist.org/packages/jminayat/laravel-menu)[ RSS](/packages/jminayat-laravel-menu/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (4)Used By (0)

JMinayaT Laravel - Menu
=======================

[](#jminayat-laravel---menu)

`jminayat/modules-laravel` is a package for the administration of menus in laravel. compatible with Laravel version 5.5.

- [Installation](#installation)
- [Creating a menu](#creating-menu)
- [Rendering menu](#rendering-menu)
- [Edit menu](#edit-menu)
- [Configuration](#configuration)

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

[](#installation)

Install the package through the composer.

```
composer require jminayat/laravel-menu
```

Next, publish the package configuration file by running:

```
php artisan vendor:publish --provider="JMinayaT\Menus\MenusServiceProvider"
```

Creating a menu
---------------

[](#creating-a-menu)

For the creation of a menu, call the creation method from Menu facade. The first parameter is the name of the menu and the second parameter is the callback to define the menu items.

```
Menu::create('test',function($menu){
    $menu->link('home/1','Home',['icon'=>'icon-home']);
});
```

### Make Multiple Menus

[](#make-multiple-menus)

If you want to create multiple menus

```
Menu::create('test1',function($menu){
    $menu->link('home/1','Home',['icon'=>'icon-home']);
});

Menu::create('test2',function($menu){
    $menu->link('user','user');
});
```

### Menu items

[](#menu-items)

### Menu Link

[](#menu-link)

To create a link menu item use `$menu->link()`

```
Menu::create('test',function($menu){
    //           'url'   'title'     'attributes'
    $menu->link('home/1','Home',['icon'=>'icon-home']);
});
```

### Menu Route

[](#menu-route)

If you have a rute element defined with your name, use `$menu->route()`

```
Menu::create('test',function($menu){
    //           'name rute'  'title'  'route parameters'    'attributes'
    $menu->route('cars.show', 'Cars', ['name'=>'toyota'], ['icon'=>'icon-car']);
});
```

### Menu Dropdown

[](#menu-dropdown)

to create a dropdown menu item use `$menu->dropdown()`

```
Menu::create('test',function($menu){
    //             'title'    'attributes'          'callback '
    $menu->dropdown('test',['icon'=>'icon-test'], function($item){
            $item->link('/test','test1',['icon'=>'fa-fa-icon']);
            $item->link('/test','test2',['icon'=>'fa-fa-icon']);
            $item->link('/test','test3');
    });
});
```

### Menu Dropdown Multi Level

[](#menu-dropdown-multi-level)

To create a drop-down menu within another drop-down menu use `$item->dropdown()`

```
Menu::create('test',function($menu){
    //             'title'    'attributes'          'callback '
    $menu->dropdown('test',['icon'=>'icon-test'], function($item){
            $item->link('/test','test1');

            $item->dropdown('test',['icon'=>'icon-test'], function($item){
                $item->link('/test','test2');
            });
    });
});
```

### Order Menu Items

[](#order-menu-items)

You can sort the menu items in two ways, by the order number or alphabetically.

By default in the configuration file the ordering is deactivated, you can activate it directly in the configuration file or use the method `$menu->activeOrder()`.

```
Menu::create('test',function($menu){
    $menu->activeOrder();
});
```

To set the value of the order call the method `->order()`.

```
Menu::create('test',function($menu){
    $menu->activeOrder(); //active order
    $menu->link('home/1','Home',['icon'=>'icon-home'])->order(1);
    $menu->link('contact','Contact',['icon'=>'icon-contact'])->order(3);
    $menu->link('pages','Pages',)->order(2);
});
```

To order alphabetically use the method `$menu->setOrderBy($type)`.

```
Menu::create('test',function($menu){
    $menu->activeOrder();// active order
    $menu->setOrderBy('title'); // 'title' or 'number'
});
```

By default, the orden function is disabled. You can enable the order function in your configuration file.

```
return [
	'ordered' => true
];
```

And the type of order, by default is order by number.

```
return [
	'orderBy' => 'title'
];
```

Rendering menu
--------------

[](#rendering-menu)

To render the menu you can use `show` or `get` method.

```
Menu::get('test');

Menu::show('test');
```

Edit menu
---------

[](#edit-menu)

To edit a menu already created use the `edit` method of the facade Menu.

```
Menu::edit('test',function($menu){
    $menu->link('home/1','Home',['icon'=>'icon-home']); // add link item
});
```

To edit an item in a menu.

```
Menu::edit('test',function($menu){
    //            'search parameter'   'name'
    $menuItem = $menu->edit('title', 'test');
    $menuItem->title = 'hola';
});
```

To edit elements of a dropdown.

```
Menu::edit('test',function($menu){
    //            'search parameter'   'name'
    $menuItem = $menu->edit('title', 'test'); //dropdown item
    $menuItem->link('/test2','testt2',['icon'=>'fa-fa-icon']); //add dropdown item
    //                   'search parameter'   'name'
    $subMenuItem = $menuItem->edit('title', 'test1'); //edit dorpdown item
    $subMenuItem->title = 'test3';
});
```

Configuration
-------------

[](#configuration)

to publish the package configuration use the following command

```
php artisan vendor:publish --provider="JMinayaT\Menus\MenusServiceProvider"
```

The content of the configuration file is as follows:

```
return [

    'aspect' => [

      'MtsysAdmin'  => 'JMinayaT\Menus\Aspects\MtsysAdmin\SidebarMenuAspect',
    ],

    'default_aspect' => 'MtsysAdmin',

    'ordered'   =>    false,

    'orderBy'   =>    'number',

];
```

### aspect

[](#aspect)

These are available ready to use menu aspects.

### default\_aspect

[](#default_aspect)

set the default aspect.

### ordered

[](#ordered)

Enable or disable menu item ordering for all menus.

### orderBy

[](#orderby)

Set the default order type in alphabet or number.

License
-------

[](#license)

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

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity65

Established project with proven stability

 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

3050d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/84bb0bd30785816166cc0429ba59ce526bf60df47418f56c294263e2ab3569c7?d=identicon)[jminayat](/maintainers/jminayat)

---

Top Contributors

[![JMinayaT](https://avatars.githubusercontent.com/u/25724149?v=4)](https://github.com/JMinayaT "JMinayaT (8 commits)")

---

Tags

laravelmenumenusjminayat

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[nedwors/navigator

A Laravel package to ease defining navigation menus

433.1k](/packages/nedwors-navigator)[rinvex/laravel-menus

Rinvex Menus is a simple menu builder package for Laravel, that supports hierarchical structure, ordering, and styling with full flexibility using presenters for easy styling and custom structure of menu rendering.

294.0k20](/packages/rinvex-laravel-menus)[nguyendachuy/laravel-menu

Laravel Menu Builder | Drag &amp; Drop | Bootstrap | Laravel 7 | Laravel 8 | Laravel 9 | Laravel 10 | Laravel 11 | Laravel 12

162.2k](/packages/nguyendachuy-laravel-menu)

PHPackages © 2026

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