PHPackages                             acid-solutions/menufactory - 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. acid-solutions/menufactory

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

acid-solutions/menufactory
==========================

A tool to create cool menu with PHP

v0.0.2(10y ago)01.7kMITPHPPHP &gt;=5.4.0

Since May 26Pushed 10y ago3 watchersCompare

[ Source](https://github.com/ACID-Solutions/menufactory)[ Packagist](https://packagist.org/packages/acid-solutions/menufactory)[ RSS](/packages/acid-solutions-menufactory/feed)WikiDiscussions master Synced 1mo ago

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

Menu Factory
------------

[](#menu-factory)

Create complex menu without stress.

### How to install

[](#how-to-install)

Edit app/config/app.php Add

```
// 'providers'
'AcidSolutions\MenuFactory\MenuFactoryServiceProvider',
```

And

```
// 'aliases'
'MenuFactory' => 'AcidSolutions\MenuFactory\MenuFactoryFacade',
```

### How to use

[](#how-to-use)

Call the factory

```
$menu = MenuFactory::createMenu('MenuName');
```

Define one or more children

```
$menu->add('Menu without Child');

```

Get html render for one menu

```
$menu->renderHtml();
// OR
MenuFactory::render('MenuName');
```

#### Pattern

[](#pattern)

Pattern is a decoration for label

```
$menu->add('Menu without Child but with pattern')->pattern('__LABEL__');
# OR
$pattern = '__LABEL__';
$menu->add('Menu without Child but with pattern1')->pattern($pattern);
$menu->add('Menu without Child but with pattern2')->pattern($pattern);
$menu->add('Menu without Child but with pattern3')->pattern($pattern);
```

#### Chained multilevel

[](#chained-multilevel)

Create multilevel menu by chaining add

```
$menu->add('Menu with chained child')->add('First level')->add('Second level')->add('third level')->add('Fourth level');
```

#### Multiple child with closure

[](#multiple-child-with-closure)

Create Multiple children with closure, you've access to all options

```
$menu->add('Menu with multiple child defined by closure', function ($menu) {
  $menu->add('first child');
  $menu->add('second child');
  $menu->add('third child');
});
```

More menu? OK Let's DO ITTTT

```
$menu->add('Menu with multiple child with multiple child defined by closure', function ($menu) {
  $menu->add('first child', function ($menu) {
    $menu->add('first child');
    $menu->add('second child');
    $menu->add('third child');
  });
  $menu->add('second child', function ($menu) {
    $menu->add('first child');
    $menu->add('second child');
    $menu->add('third child');
  });
  $menu->add('third child', function ($menu) {
    $menu->add('first child');
    $menu->add('second child');
    $menu->add('third child');
  });
});
```

#### Allow access with Closure

[](#allow-access-with-closure)

Sometime you need to hide or show menu item to group of user. Use closure to defined it!

```
// Using Sentry::check() for this example (it will check if user is auth)
$userAuth = Sentry::check();
$menu->add('Menu with allow function')->allow(function () use ($userAuth) {
  // You can do everything you want here
  return $userAuth;
});

$menu->add('Menu with allow function (gonna be hide)')->allow(function () use ($userAuth) {
  // You can do everything you want here
  return !$userAuth;
});

// Wait, why closure if i've the value?
$menu->add('Menu with allow function (gonna be hide)')->allow($userAuth);
```

#### Option on item

[](#option-on-item)

To Apply option to an item (class, click, bisous)

```
$menu->add('Menu with Option')->option('class', 'btn');
```

Oh Shit i want to add `btn` class on the `a`, `btn-group` on the container `li` of the `a` and a `dropdown-menu` if this element have children...HOW!

```
$menu->add('Menu with Option')
  ->option('class', 'btn')
  ->option('class', 'btn-group', 'li')
  ->option('class', 'dropdown-menu', 'ul');
```

#### What's about LInk?

[](#whats-about-link)

Oh yes! links...

```
$menu->add('Menu with uri')->uri('to_this_uri');
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

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

Total

2

Last Release

4008d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e0872a7b81ab21033b2fe8ffcca970ca17a28b92ba9638ae90621ed826d7acb7?d=identicon)[daniel-acid](/maintainers/daniel-acid)

---

Top Contributors

[![daniel-chris-lucas](https://avatars.githubusercontent.com/u/2169418?v=4)](https://github.com/daniel-chris-lucas "daniel-chris-lucas (2 commits)")

### Embed Badge

![Health badge](/badges/acid-solutions-menufactory/health.svg)

```
[![Health](https://phpackages.com/badges/acid-solutions-menufactory/health.svg)](https://phpackages.com/packages/acid-solutions-menufactory)
```

###  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

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

The Illuminate Pipeline package.

9346.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)
