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

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

erendi/menu
===========

Drag and Drop Menu Builder

1.0.1(4y ago)1241MITJavaScriptPHP ^7.3 || ^8.0

Since Dec 11Pushed 4y ago1 watchersCompare

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

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

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

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

bercabang dari [![Laravel drag and drop menu](https://raw.githubusercontent.com/harimayco/wmenu-builder/master/screenshot.png)](https://raw.githubusercontent.com/harimayco/wmenu-builder/master/screenshot.png)

### Installation

[](#installation)

1. Run

```
composer require erendi/menu
```

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

2. Tambahkan kelas berikut, ke array "providers" di file config/app.php

```
Erendi\Menu\MenuServiceProvider::class,
```

3. tambahkan facades di file config/app.php

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

4. Run publish

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

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

- ***CUSTOM MIDDLEWARE:*** untuk menambahkan midlleware anda sendiri
- ***TABLE PREFIX:*** default pacakge mempunay 2 table database "menus" and "menu*items" dan membunakan admin* sebagai prefix pada table nya
- ***TABLE NAMES*** anda juga dapat memodifikasi nama table untuk file migration anda di baris ini
- ***Custom routes*** jika anda ingin merubah route path nya anda bisa merubah pada bari ini
- ***Role Access*** jika anda ingin memberikan permision pada menu ada anda dapat atur pada baris ini

6. Jalankan migrasi laravel untuk membuat table pada database anda

```
php artisan migrate
```

DONE

### Cara penggunaan Menu Builder ini

[](#cara-penggunaan-menu-builder-ini)

jika anda ingin menampilkan pada file .blade.php anda tinggal anda atur menu rendernya saja letakan di antara section yg anda buat sendiri

```
@extends('app') // sesuaikan dengan extend yg anda buat

@section('contents') // baris ini anda sesuaikan dengan milik anda
    {!! Menu::render() !!}
@endsection

//YOU MUST HAVE JQUERY LOADED BEFORE menu scripts
@push('scripts') // jika menggunakan @push pada tempale anda tambah kan di paling akhir baris tags script pada html anda @stack('ext_scripts')
    {!! Menu::scripts() !!}
@endpush
```

### Menggunakan Model

[](#menggunakan-model)

Memanggil model class

```
use Erendi\Menu\Models\Menus;
use Erendi\Menu\Models\MenuItems;
```

##### Menggunakan Model Class

[](#menggunakan-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();
```

##### atau gunakan helper

[](#atau-gunakan-helper)

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

### Menu Usage Example (b)

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

Sekarang di dalam file template blade Anda, letakkan menu menggunakan contoh sederhana ini

```

        @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)

### Ambil Menu Items By Menu ID

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

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

### Ambil Menu Items By Menu Name

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

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

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

### Customization

[](#customization)

Anda dapat mengedit antarmuka menu di ***resources/views/vendor/wmenu/menu-html.blade.php***

### Credits

[](#credits)

- [wmenu](https://github.com/lordmacu/wmenu) laravel package menu like wordpress (developer original)

### Compatibility

[](#compatibility)

- Tested with laravel 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 6.x, 7.x, 8.x

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity54

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

Unknown

Total

1

Last Release

1616d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5b156c8695cdca5806090f543f6d59128c24593175a033f905302985f98a0212?d=identicon)[bimacoding](/maintainers/bimacoding)

---

Top Contributors

[![bimacoding](https://avatars.githubusercontent.com/u/61307168?v=4)](https://github.com/bimacoding "bimacoding (7 commits)")

### Embed Badge

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

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

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M158](/packages/orchestra-canvas)[illuminate/pipeline

The Illuminate Pipeline package.

9446.6M213](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M862](/packages/illuminate-pagination)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)

PHPackages © 2026

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