PHPackages                             helingfeng/simple-permission - 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. helingfeng/simple-permission

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

helingfeng/simple-permission
============================

1.2(7y ago)29PHPCI failing

Since Apr 4Pushed 7y ago1 watchersCompare

[ Source](https://github.com/helingfeng/simple-permission)[ Packagist](https://packagist.org/packages/helingfeng/simple-permission)[ RSS](/packages/helingfeng-simple-permission/feed)WikiDiscussions master Synced 2d ago

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

simple-permission
=================

[](#simple-permission)

Laravel 扩展包，让后端的菜单与权限控制如此轻松，基于角色的权限控制，简单所以高效

Composer 安装
-----------

[](#composer-安装)

```
composer require helingfeng/simple-permission
```

```
php artisan vendor:publish
```

数据库迁移
-----

[](#数据库迁移)

```
php artisan migrate
php artisan db:seed --class=LaravelUsersSeeder
```

菜单结构 ？
------

[](#菜单结构-)

菜单 `menu.php` 文件，定义了菜单与权限的基础信息。为了简单起见，菜单`固定`为`三层级`结构， 第一第二层级作为`模块声明`定义，第三层级做`有效链接`定义，详情可以直接浏览`menu.php` 文件。

字段描述slug作为菜单标识字符串，同层级下不允许重复出现icon图标 CSS CLASS 配置，例如 fa-dashboardroute跳转链接，具体根据系统情况定义，此参数第三层级才有效expect配置为1时，弃用默认权限（查看、编辑、删除）permission自定义权限，KEY-VALUE 组成，允许覆盖默认（查看、编辑、删除）权限权限命令
----

[](#权限命令)

- 获取当前数据库配置的所有菜单清单

```
php artisan command:menu
```

[![](./demo1.jpg)](./demo1.jpg)

- 获取数据库配置的所有权限可选项

```
php artisan command:permission
```

[![](./demo2.jpg)](./demo2.jpg)

- 输出当前看守者用户的拥有的权限与菜单

```
php artisan command:user
```

[![](./demo3.jpg)](./demo3.jpg)

如何使用
----

[](#如何使用)

- 路由中控制权限

对访问的路由进行权限配置，此处的权限标识与`menu.php`文件保持一致即可

```
Route::group(['middleware' => 'permission:platform.dashboard.orders.show'], function(Router $router){
    //... your router
});
```

- 页面模板中控制权限

自定义模板标签

```
@can('platform.dashboard.orders.export')
    // todo your code
@endcan
```

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

Established project with proven stability

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

Total

6

Last Release

2644d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2fb3ad2578715bc0e3691074e3d19d064a2cd1726d08ab29f80b22ca9302263a?d=identicon)[helingfeng](/maintainers/helingfeng)

---

Top Contributors

[![helingfeng](https://avatars.githubusercontent.com/u/4921878?v=4)](https://github.com/helingfeng "helingfeng (15 commits)")

---

Tags

laravellaravel-5-packagepermission

### Embed Badge

![Health badge](/badges/helingfeng-simple-permission/health.svg)

```
[![Health](https://phpackages.com/badges/helingfeng-simple-permission/health.svg)](https://phpackages.com/packages/helingfeng-simple-permission)
```

###  Alternatives

[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135212.4k7](/packages/statamic-rad-pack-runway)

PHPackages © 2026

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