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

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

nguyendachuy/laravel-menu
=========================

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

v1.0.2(3mo ago)162.2k↓90%15[1 issues](https://github.com/nguyendachuy/laravel-menu/issues)PHPPHP &gt;=7.2.5

Since Oct 29Pushed 3mo agoCompare

[ Source](https://github.com/nguyendachuy/laravel-menu)[ Packagist](https://packagist.org/packages/nguyendachuy/laravel-menu)[ RSS](/packages/nguyendachuy-laravel-menu/feed)WikiDiscussions master Synced 3w ago

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

Laravel Drag and Drop menu
==========================

[](#laravel-drag-and-drop-menu)

[![Latest Stable Version](https://camo.githubusercontent.com/131c3a96176463cf75dd3e1dc1e5e92714fe157acb01179324c85eddf4a45d68/68747470733a2f2f706f7365722e707567782e6f72672f6e677579656e6461636875792f6c61726176656c2d6d656e752f76)](//packagist.org/packages/nguyendachuy/laravel-menu) [![Total Downloads](https://camo.githubusercontent.com/f83e48aa6596a2279edaa59da32fb684cb4da89016a982d83200e54ed48f5a4c/68747470733a2f2f706f7365722e707567782e6f72672f6e677579656e6461636875792f6c61726176656c2d6d656e752f646f776e6c6f616473)](//packagist.org/packages/nguyendachuy/laravel-menu) [![Latest Unstable Version](https://camo.githubusercontent.com/ec9847a6e3a2b0d1db10c21fbadc4aa4810cd907690242eaf1c46e60a89ff28c/68747470733a2f2f706f7365722e707567782e6f72672f6e677579656e6461636875792f6c61726176656c2d6d656e752f762f756e737461626c65)](//packagist.org/packages/nguyendachuy/laravel-menu) [![License](https://camo.githubusercontent.com/ac17f51dce03632a7e0c10cfff807683432c9f6c0b5feaf02c3be4aaaf2af2ac/68747470733a2f2f706f7365722e707567782e6f72672f6e677579656e6461636875792f6c61726176656c2d6d656e752f6c6963656e7365)](//packagist.org/packages/nguyendachuy/laravel-menu)

[![Laravel drag and drop menu](https://raw.githubusercontent.com/nguyendachuy/laravel-menu/master/screenshot.png)](https://raw.githubusercontent.com/nguyendachuy/laravel-menu/master/screenshot.png)

Important Notice: Major Upgrade Available
-----------------------------------------

[](#important-notice-major-upgrade-available)

We're excited to announce a major upgrade of Laravel Drag and Drop Menu Builder available on the `upgrade-version` branch. This version adds significant new features and improvements, especially comprehensive multilingual support.

### New Features and Improvements

[](#new-features-and-improvements)

- **Complete Multilingual Support**: User interface and system messages translated into multiple languages (currently English and Vietnamese)
- **Migration from Bootstrap to Tailwind CSS**: Completely redesigned interface with Tailwind CSS, providing a more modern and flexible experience
- **Mega Menu Support**: Create mega menus with custom content
- **Advanced JavaScript Integration**: Translation system integrated into JavaScript, allowing messages to be displayed in the user's language
- **Improved UX/UI**: Modern interface with intuitive drag-and-drop feedback
- **Performance Optimization**: Improved performance with caching system and query optimization
- **Robust Error Handling**: Comprehensive validation and error recovery system
- **Critical Bug Fixes**: Fixed issues including Menu Name and Menu Class not updating when clicking Update Menu

### How to Use the `upgrade-version` Branch

[](#how-to-use-the-upgrade-version-branch)

#### Option 1: Direct Git Checkout

[](#option-1-direct-git-checkout)

```
# Clone repository (if you don't have it)
git clone https://github.com/nguyendachuy/laravel-menu.git

# Switch to upgrade-version branch
git checkout upgrade-version

# Install dependencies
composer install
```

#### Option 2: Using Composer (Recommended for Projects)

[](#option-2-using-composer-recommended-for-projects)

Update your `composer.json` file to use the upgrade-version branch:

```
{
    "require": {
        "nguyendachuy/laravel-menu": "dev-upgrade-version"
    }
}
```

Then run:

```
composer update nguyendachuy/laravel-menu
```

### Database Updates

[](#database-updates)

The new version adds columns for the Mega Menu feature. Run migrations to update your database structure:

```
php artisan migrate
```

The migration will add the following columns to the `menu_items` table:

- `is_mega_menu` (boolean): Determines if an item is a mega menu
- `mega_menu_content` (text): Stores the HTML content of the mega menu

### Updating Resources

[](#updating-resources)

The new version includes many changes to config, views, and public files. Run the following command to update:

```
# Publish all resources
php artisan vendor:publish --provider="NguyenHuy\Menu\Providers\MenuServiceProvider" --force

# Or publish specific resource types
php artisan vendor:publish --tag=laravel-menu-config --force
php artisan vendor:publish --tag=laravel-menu-views --force
php artisan vendor:publish --tag=laravel-menu-assets --force
php artisan vendor:publish --tag=laravel-menu-translations --force
```

**Important Note**: Using `--force` will overwrite any customizations you've made. If you've customized files, back them up before running these commands.

### Important Note

[](#important-note)

The `upgrade-version` branch has not yet been merged into `master` to avoid affecting current users. We encourage you to test this branch in a development environment before applying it to production projects.

Feedback and contributions are welcome to help us improve this package before the official release.

Please refer to the README.md in the `upgrade-version` branch for complete details on new features and usage instructions.

### Installation

[](#installation)

1. Run

```
composer require nguyendachuy/laravel-menu
```

2. Run publish

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

3. 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
- ***CACHE ENABLED:*** Set this to `true` if you want to enable caching for menu items. Default is `false`.
- ***CACHE KEY PREFIX:*** The prefix to use for cache keys. Default is `'menu'`.
- ***CACHE TTL:*** The time-to-live (in minutes) for cached menu items. Default is `60`.

4. 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 NguyenHuy\Menu\Models\Menus;
use NguyenHuy\Menu\Models\MenuItems;
```

### 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 = Menus::find(1);
/* or by name */
$menu = Menus::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 = Menus::where('name','Test Menu')->with('items')->first();
/*or by id */
$menu = Menus::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 NguyenHuy\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 NguyenHuy\Menu\Facades\Menu;
...
/*
Parameter: Menu ID
Return: Array
*/
$menuList = Menu::getByName('Admin');
```

### Customization

[](#customization)

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

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance80

Actively maintained with recent releases

Popularity30

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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

Total

3

Last Release

101d ago

PHP version history (2 changes)v1.0.0PHP &gt;=7.0

v1.0.1PHP &gt;=7.2.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/51a37c190ab4fecfeb65c235b1922b254b42e3f063bd1c5c4d48a76833dad5ba?d=identicon)[huy.cit](/maintainers/huy.cit)

---

Top Contributors

[![harimayco](https://avatars.githubusercontent.com/u/5478980?v=4)](https://github.com/harimayco "harimayco (62 commits)")[![nguyendachuy](https://avatars.githubusercontent.com/u/15666602?v=4)](https://github.com/nguyendachuy "nguyendachuy (23 commits)")[![lordmacu](https://avatars.githubusercontent.com/u/10134930?v=4)](https://github.com/lordmacu "lordmacu (20 commits)")[![DeveloperOnCall](https://avatars.githubusercontent.com/u/3272625?v=4)](https://github.com/DeveloperOnCall "DeveloperOnCall (18 commits)")[![monwolf](https://avatars.githubusercontent.com/u/1116133?v=4)](https://github.com/monwolf "monwolf (5 commits)")[![ezequiel9](https://avatars.githubusercontent.com/u/15575053?v=4)](https://github.com/ezequiel9 "ezequiel9 (5 commits)")[![buzzclue](https://avatars.githubusercontent.com/u/43321373?v=4)](https://github.com/buzzclue "buzzclue (3 commits)")[![deep2065](https://avatars.githubusercontent.com/u/23185745?v=4)](https://github.com/deep2065 "deep2065 (2 commits)")[![SadiqUltra](https://avatars.githubusercontent.com/u/6016404?v=4)](https://github.com/SadiqUltra "SadiqUltra (1 commits)")[![konmavrakis](https://avatars.githubusercontent.com/u/5990379?v=4)](https://github.com/konmavrakis "konmavrakis (1 commits)")[![lordmacus](https://avatars.githubusercontent.com/u/9418745?v=4)](https://github.com/lordmacus "lordmacus (1 commits)")[![nauvalazhar](https://avatars.githubusercontent.com/u/14899175?v=4)](https://github.com/nauvalazhar "nauvalazhar (1 commits)")[![obiihuy](https://avatars.githubusercontent.com/u/155449672?v=4)](https://github.com/obiihuy "obiihuy (1 commits)")[![odhier](https://avatars.githubusercontent.com/u/28082192?v=4)](https://github.com/odhier "odhier (1 commits)")

---

Tags

bootstrapbuilderdrag-and-droplaravelmenuphplaravelbuildermenubootstrapdragdrop

### Embed Badge

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

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[codexshaper/laravel-menu-builder

Laravel Drag and Drop Menu Builder

932.6k](/packages/codexshaper-laravel-menu-builder)

PHPackages © 2026

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