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

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

cmxperts/laravel-menu
=====================

Drag and Drop Menu Generator for Laravel 10

v1.02(2y ago)0391[1 PRs](https://github.com/cmxperts/laravel-menu/pulls)BladePHP ^8.0

Since Jul 25Pushed 2y ago1 watchersCompare

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

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

menu
====

[](#menu)

Drag and Drop Menu Generator for Laravel 10

### Installation

[](#installation)

1. Run

```
composer require cmxperts/laravel-menu
```

***Step 2 &amp; 3 are optional if you are using laravel 5.5***

2. Add the following class, to "providers" array in the file config/app.php (optional on laravel 5.5)

```
CmXperts\Menu\Providers\MenuServiceProvider::class,
```

3. add facade in the file config/app.php (optional on laravel 5.5)

```
'Menu' => CmXperts\Menu\Facades\Menu::class,
```

4. Run publish

```
php artisan vendor:publish --provider="CmXperts\Menu\Providers\MenuServiceProvider"
```

5. Configure (optional) in ***config/menu.php*** :

- ***CUSTOM MIDDLEWARE:*** You can add you own middleware
- ***TABLE PREFIX:*** By default this package will create 2 new tables named "menus" and "menu\_items" but you can still add your own table prefix avoiding conflict with existing table
- ***TABLE NAMES*** If you want use specific name of tables you have to modify that and the migrations
- ***Custom routes*** If you want to edit the route path you can edit the field
- ***Role Access*** If you want to enable roles (permissions) on menu items

6. Run migrate

```
php artisan migrate
```

DONE

### Menu Builder Usage Example - displays the builder

[](#menu-builder-usage-example---displays-the-builder)

On your view blade file

```
@extends('app')

@section('contents')
    {!! Menu::render() !!}
@endsection

//YOU MUST HAVE JQUERY LOADED BEFORE menu scripts
@push('scripts')
    {!! Menu::scripts() !!}
@endpush
```

### Using The Model

[](#using-the-model)

Call the model class

```
use CmXperts\Menu\Models\Menu;
use CmXperts\Menu\Models\MenuItem;
```

### Menu Usage Example (a)

[](#menu-usage-example-a)

A basic two-level menu can be displayed in your blade template

##### Using Model Class

[](#using-model-class)

```
/* get menu by id*/

$menu = Menu::find(1);
/* or by name */
$menu = Menu::where('name','Test Menu')->first();

/* or get menu by name and the items with EAGER LOADING (RECOMENDED for better performance and less query call)*/
$menu = Menu::where('name','Test Menu')->with('items')->first();
/*or by id */
$menu = Menu::where('id', 1)->with('items')->first();

//you can access by model result
$public_menu = $menu->items;

//or you can convert it to array
$public_menu = $menu->items->toArray();
```

##### or Using helper

[](#or-using-helper)

```
// Using Helper
$public_menu = Menu::getByName('Public'); //return array
```

### Menu Usage Example (b)

[](#menu-usage-example-b)

Now inside your blade template file place the menu using this simple example

```

        @if($public_menu)

            @foreach($public_menu as $menu)

                {{ $menu['label'] }}
                @if( $menu['child'] )

                    @foreach( $menu['child'] as $child )
                        {{ $child['label'] }}
                    @endforeach

                @endif

            @endforeach
        @endif

```

### HELPERS

[](#helpers)

### Get Menu Items By Menu ID

[](#get-menu-items-by-menu-id)

```
use CmXperts\Menu\Facades\Menu;
...
/*
Parameter: Menu ID
Return: Array
*/
$menuList = Menu::get(1);
```

### Get Menu Items By Menu Name

[](#get-menu-items-by-menu-name)

In this example, you must have a menu named *Admin*

```
use CmXperts\Menu\Facades\Menu;
...
/*
Parameter: Menu ID
Return: Array
*/
$menuList = Menu::getByName('Admin');
```

### Customization

[](#customization)

you can edit the menu interface in ***resources/views/vendor/cmxperts-menu/menu-html.blade.php***

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity51

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

Total

3

Last Release

1008d ago

### Community

Maintainers

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

---

Top Contributors

[![cmxperts](https://avatars.githubusercontent.com/u/139944228?v=4)](https://github.com/cmxperts "cmxperts (12 commits)")

---

Tags

laravelbuildermenubootstrap

### Embed Badge

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

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

###  Alternatives

[akaunting/laravel-menu

Menu and sidebar management package for Laravel

38233.8k](/packages/akaunting-laravel-menu)[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)[inkvizytor/fluentform

Form builder for Laravel

3416.2k](/packages/inkvizytor-fluentform)[nedwors/navigator

A Laravel package to ease defining navigation menus

433.1k](/packages/nedwors-navigator)

PHPackages © 2026

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