PHPackages                             lwj/laravel-rbac - 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. [Queues &amp; Workers](/categories/queues)
4. /
5. lwj/laravel-rbac

ActiveLibrary[Queues &amp; Workers](/categories/queues)

lwj/laravel-rbac
================

基于权限

0.1.2(6y ago)29[22 PRs](https://github.com/wangzhoudong/laravel-rbac/pulls)MITPHPPHP &gt;=7.1.0

Since Nov 22Pushed 3y ago2 watchersCompare

[ Source](https://github.com/wangzhoudong/laravel-rbac)[ Packagist](https://packagist.org/packages/lwj/laravel-rbac)[ RSS](/packages/lwj-laravel-rbac/feed)WikiDiscussions master Synced today

READMEChangelog (3)Dependencies (1)Versions (26)Used By (0)

\#基于数据的RBAC

适用于前后端分离项目的权限管理

树形菜单 角色管理 用户管理 API管理

### Install

[](#install)

Require this package with composer using the following command:

```
composer require lwj/laravel-rbac
```

After updating composer, add the service provider to the `providers` array in `config/app.php`

```
Lwj\Rbac\ServiceProvider::class,
```

**Laravel 5.5** uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.

Add the middleware alias `routeMiddleware` array in `app/Http/Kernel.php`

```
'jwt.auth' => \Tymon\JWTAuth\Http\Middleware\Authenticate::class,
'jwt.refresh' => \Tymon\JWTAuth\Http\Middleware\RefreshToken::class,
```

Generate the ENV option:

```
php artisan jwt:secret
```

### Config

[](#config)

You can also publish the config file to change implementations (ie. interface to specific class) or set defaults for `--helpers` or `--sublime`.

```
php artisan vendor:publish --provider="Lwj\Rbac\ServiceProvider" --tag=config
php artisan vendor:publish --provider="Lwj\Rbac\ServiceProvider" --tag=assets
php artisan vendor:publish --provider="Tymon\JWTAuth\Providers\LaravelServiceProvider"
```

Inside the config/auth.php file you will need to make a few changes to configure Laravel to use the jwt guard to power your application authentication.

Make the following changes to the file 'config/auth':

```
use Lwj\Rbac\Models\User;
```

And change the array:

```
'defaults' => [
    'guard' => 'api',
    'passwords' => 'users',
],

...

'guards' => [
    ...,
    'api' => [
        'driver' => 'token',
        'provider' => 'users',
    ],
    'rbac' => [
        'driver' => 'jwt',
        'provider' => 'users',
    ]
],

...

'providers' => [
        'users' => [
            'driver' => 'eloquent',
            'model' => User::class,
        ],
    ],
```

### Migration

[](#migration)

You can also migrate tables and base data:

```
php artisan migrate
```

### User

[](#user)

Default User:

```
name: admin@liweijia.com
password: 123456
```

'SUPER\_ADMIN' env option to set super admin in this system: if you want to add new super admin,you can use '|' separator

```
eg:SUPER_ADMIN=admin@liweijia.com|test@liweijia.com
```

进入docker之后 ln -sf /var/www/html/pay-php/service2/packages/laravel-rbac/public /var/www/html/pay-php/service2/public/vendor/rbac

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

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

Total

3

Last Release

2357d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4695837?v=4)[wangzd](/maintainers/wangzd)[@wangzd](https://github.com/wangzd)

---

Tags

laravelqueue

### Embed Badge

![Health badge](/badges/lwj-laravel-rbac/health.svg)

```
[![Health](https://phpackages.com/badges/lwj-laravel-rbac/health.svg)](https://phpackages.com/packages/lwj-laravel-rbac)
```

###  Alternatives

[harris21/laravel-fuse

Circuit breaker for Laravel queue jobs. Protect your workers from cascading failures.

3786.5k](/packages/harris21-laravel-fuse)[pmatseykanets/artisan-beans

Easily manage your Beanstalkd job queues right from the Laravel artisan command

4482.1k](/packages/pmatseykanets-artisan-beans)

PHPackages © 2026

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