PHPackages                             doc88/flux-menu-control - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. doc88/flux-menu-control

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

doc88/flux-menu-control
=======================

Library for implementing menu access control in Laravel applications.

1.0.0(5y ago)04.4kMITPHPPHP &gt;= 7.2.0

Since Jul 30Pushed 5y ago4 watchersCompare

[ Source](https://github.com/doc88git/flux-menu-control)[ Packagist](https://packagist.org/packages/doc88/flux-menu-control)[ RSS](/packages/doc88-flux-menu-control/feed)WikiDiscussions master Synced today

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

Flux Menu Control
=================

[](#flux-menu-control)

Library for managing user's menu.

Requirements
============

[](#requirements)

- Laravel &gt;= 6.0
- Flux Role Permission &gt;= 1.0.2

Installation
============

[](#installation)

- Run the command below at the project root to add the package to the Laravel application:

```
    composer require doc88/flux-menu-control
```

- In the *providers* list in the *config/app.php* file add:

```
    'providers' => [
        ...
        Doc88\FluxMenuControl\FluxMenuControlServiceProvider::class,
    ]
```

- Run the command below at the root of your project to publish the new provider:

```
    php artisan vendor:publish
```

- Run migrations

```
    php artisan migrate
```

- In your User Model add the following lines:

```
    use Doc88\FluxMenuControl\Traits\MenuMount;

    class User {
        use MenuMount;
    }
```

Usage
=====

[](#usage)

Doc88\\FluxMenuControl\\Menu Class
----------------------------------

[](#doc88fluxmenucontrolmenu-class)

Class used to Create, Remove, Attach and Dettach Menus and Permission.

- **Create a Menu Item**

```
    // Create a new Menu Item
    Menu::create([
        'module' => 'Label of Menu Item', // required
        'slug' => 'menu-slug', // required
        'icon' => 'menu-item-icon-class' // optional,
        'parent' => 'parent-menu-item-slug' // optional
    ]);

    // Return (array):
    [
        'module'    => 'Label of Menu Item',
        'slug'      => 'menu-slug',
        'icon'      => null,
        'parent_id' => null
    ]
```

- **Remove a Menu Item**

```
    // Remove a Menu Item
    Menu::remove('menu-slug');

    // Return (bool)
    true or false
```

- **Attach a permission to Menu Item**

```
    // Attaching list-users permissions to menu-slug menu
    Menu::attachPermission('menu-slug', 'list-users');

    // Return (bool)
    true or false
```

- **Dettach a permission from a Menu Item**

```
    // Dettaching list-users permissions to menu-slug menu
    Menu::dettachPermission('menu-slug', 'list-users');

    // Return (bool)
    true or false
```

- **Synchronize Permissions to generate the user's menu**

```
    // Synchronizing
    Menu::sync($user);

    // Return (array)
    [
        [
            "module" => "Label of Menu Item",
            "slug" => "menu-slug",
            "icon" => null,
        ],
    ],
```

- **Get user's menu**

```
    // Getting user's menu
    Menu::get($user);

    // Return (array)
    [
        [
            "module" => "Label of Menu Item",
            "slug" => "menu-slug",
            "icon" => null,
        ],
    ],
```

Using the User Model
--------------------

[](#using-the-user-model)

It is possible to Get the user's menu using the User class.

- **List User's Menu**

```
    $user = User::find(1);

    // User's Permissions
    $user->getMenu();

    // Return (array):
    [
        [
            "module" => "Label of Menu Item",
            "slug" => "menu-slug",
            "icon" => null,
        ],
    ],
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

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

Unknown

Total

1

Last Release

2109d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0a267e73f18e12044346da1ead7ff5b8c393b260499471a1d5b155a43884f99b?d=identicon)[doc88](/maintainers/doc88)

---

Top Contributors

[![douglas-men](https://avatars.githubusercontent.com/u/65043552?v=4)](https://github.com/douglas-men "douglas-men (2 commits)")

### Embed Badge

![Health badge](/badges/doc88-flux-menu-control/health.svg)

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

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

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