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

ActiveLaravel-package[Utility &amp; Helpers](/categories/utility)

dizatech/module-menu
====================

This package provides menu generator for modules in laravel apps.

v1.3.5(2y ago)225612MITBladePHP ^7.1|^8.1

Since Jan 18Pushed 2y ago1 watchersCompare

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

READMEChangelog (10)Dependencies (2)Versions (17)Used By (2)

Module Menu
===========

[](#module-menu)

This package has a menu manager and menu generator for laravel modules.

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

[](#installation)

Using Composer :

`composer require dizatech/module-menu`

packagist :

Admin Panel Usage
-----------------

[](#admin-panel-usage)

- publish blade files :

`php artisan vendor:publish --tag=module-menu`

\*\* Please note if you already published the vendor, for updates you can run the following command :

`php artisan vendor:publish --tag=module-menu --force`

- run the following command :

`php artisan migrate`

- Add the following code to module service provider , at the end of boot() function :

`\ModuleMenu::init('ExampleModule');`

Please note that `ExampleModule` is your module name

- Add the following tags in your sidebar layout (the module menus will be rendered by `modules` type and the menu manager will be rendered by `manager` type) :

``

``

or shorten tags :

``

``

Please note that the default type of `x-module-menu` tag is `manager`

Front-end Usage
---------------

[](#front-end-usage)

to load desktop menus you must use this tag :

``

to load mobile menus you must use this tag :

``

Create Menus
------------

[](#create-menus)

### Using UI (Menu Manager)

[](#using-ui-menu-manager)

- from `menu/create` in your panel, you can create new menu
- manage created menus in the following url :

`http://example.com/example-panel/menu`

Please note that created menus are only available in module\_menus table (in database), if you want to have migratable menus, use the `Laravel Seeder`

### Using Laravel Seeder

[](#using-laravel-seeder)

The standard structure for packages or core (4 seeder needed)

- for packages you can use pacman (package-manager) to create seeders simply.

Download and install pacman :

#### MenuSeeder

[](#menuseeder)

> Create menu items

- create `MenuSeeder` using `php artisan pacman:seeder MenuSeeder ` command
- in `run()` method add each menu in separate `if` conditions like the following codes:

\*\* parent menu (first parent menu name must be equal to package name)

```
if (DB::table('module_menus')->where('name','')->count() == 0){ // for first parent you must use package_name for menu_name
    $parentID = DB::table('menu_menus')->insertGetId([ // set parent id of menu in $parentID variable
        'name' => '', // for first parent you must use package_name for menu_name
        'title' => '', // e.g. فرم ها
        'icon' => '', // e.g. fa fa-wpforms
        'route' => '', // e.g. form.index
        'parent_id' => '0', // 0 for parent
        'creator_id' => '1', // creator user_id
        'created_at' => now()->toDateTimeString(),
        'updated_at' => now()->toDateTimeString(),
        'deleted_at' => null,
    ]);
}

```

\*\* child menu

```
if (DB::table('module_menus')->where('name','')->count() == 0){
    DB::table('module_menus')->insert([
        'name' => '', // menu name, e.g. site_forms
        'title' => '', // menu title, e.g. ایجاد فرم
        'icon' => '', // child menu icon, e.g. fa fa-circle-o
        'route' => '', // menu route, e.g. form.index
        'parent_id' => $parentID, // menu parent id, can be dynamic
        'creator_id' => '1', // creator user_id
        'created_at' => now()->toDateTimeString(),
        'updated_at' => now()->toDateTimeString(),
        'deleted_at' => null,
    ]);
}

```

#### PermissionsSeeder

[](#permissionsseeder)

> Create permission for each menu item

- create `PermissionsSeeder` using `php artisan pacman:seeder PermissionsSeeder ` command
- in `run()` method add the permissions in separate `if` conditions like the following code:

```
if (DB::table('permissions')->where('name','')->count() == 0){ // e.g. forms_access
     DB::table('permissions')->insert([
          'name' => '', // e.g. forms_access
          'display_name' => '', // e.g. دسترسی فرم ها
          'description' => '', // e.g. امکان دسترسی به فرم ها
          'created_at' => now()->toDateTimeString(),
          'updated_at' => now()->toDateTimeString()
     ]);
}

```

#### MenuPermissionsSeeder

[](#menupermissionsseeder)

> Connect each menu to specific permission

- create `MenuPermissionsSeeder` using `php artisan pacman:seeder MenuPermissionsSeeder ` command
- in `run()` method add the following codes (first find menus, then attach theme permissions):

```
$parentMenu = ModuleMenu::where('name', '')->first();
$childMenu = ModuleMenu::where('name', '')->first();

$parentMenu->permissions()->sync(Permission::where('name', '')->pluck('id'));
$childMenu->permissions()->sync(Permission::where('name', '')->pluck('id'));

```

#### RolePermissionsSeeder

[](#rolepermissionsseeder)

> Connect each permission to specific role

- create `RolePermissionsSeeder` using `php artisan pacman:seeder RolePermissionsSeeder ` command
- in `run()` method add the following codes (first find role, then attach permissions to it):

```
$ = Role::where('name', '')->first(); // main role

$permissions = DB::table('permissions')->whereIn('name', [
     '',
     '',
     ...
])->get()->pluck('id');
$->permissions()->sync($permissions, false);

```

#### add new seeders in laravel core

[](#add-new-seeders-in-laravel-core)

- add new seeders in `/database/seeders/DatabaseSeeder.php` :

```
public function run()
{
  $this->call([
     ProvinceSeeder::class,
     UserSeeder::class,
     // new classes goes here
  ]);
}

```

#### Last step for laravel seeder

[](#last-step-for-laravel-seeder)

- run artisan seed :

`php artisan db:seed`

- clear all caches :

`php artisan cache:clear`

`php artisan view:clear`

`php artisan route:clear`

ChangeLog
---------

[](#changelog)

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 95.9% 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 ~63 days

Recently: every ~202 days

Total

16

Last Release

989d ago

PHP version history (3 changes)v1.0.0PHP 7.1.\*|7.2.\*|7.3.\*|7.4.\*

v1.3.3PHP 7.1.\*|7.2.\*|7.3.\*|7.4.\*|8.\*

v1.3.4PHP ^7.1|^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/7ca25b6ce9e40a205b65efd8c9fb92865bbf6d4586f11be7ca76be0d4151b808?d=identicon)[omidfarahani](/maintainers/omidfarahani)

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

---

Top Contributors

[![sinatx](https://avatars.githubusercontent.com/u/76904071?v=4)](https://github.com/sinatx "sinatx (93 commits)")[![omidfarahani](https://avatars.githubusercontent.com/u/10830204?v=4)](https://github.com/omidfarahani "omidfarahani (3 commits)")[![saharfalah](https://avatars.githubusercontent.com/u/25864060?v=4)](https://github.com/saharfalah "saharfalah (1 commits)")

### Embed Badge

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

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

###  Alternatives

[wireui/wireui

TallStack components

1.8k1.3M16](/packages/wireui-wireui)[livewire/volt

An elegantly crafted functional API for Laravel Livewire.

4195.3M84](/packages/livewire-volt)[ramonrietdijk/livewire-tables

Dynamic tables for models with Laravel Livewire

21147.4k](/packages/ramonrietdijk-livewire-tables)

PHPackages © 2026

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