PHPackages                             lazywe/lazy-admin - 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. lazywe/lazy-admin

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

lazywe/lazy-admin
=================

基于laravel的rbac后台系统

3.5.58(2y ago)10113[2 issues](https://github.com/lazywe/lazy-admin/issues)1MITPHPCI failing

Since May 8Pushed 2y ago1 watchersCompare

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

READMEChangelogDependencies (2)Versions (33)Used By (1)

lazy-admin
==========

[](#lazy-admin)

- 基于laravel的rbac后台系统

Requirement
===========

[](#requirement)

- php &gt;= 7.0
- Composer
- laravel &gt;= 5.8
- spatie/laravel-permission

demo
====

[](#demo)

[![admin](https://user-images.githubusercontent.com/19222354/147525523-91c1bc67-eeab-4edd-a3d8-a5a4ef9c416c.png)](https://user-images.githubusercontent.com/19222354/147525523-91c1bc67-eeab-4edd-a3d8-a5a4ef9c416c.png)[![admin_menu](https://user-images.githubusercontent.com/19222354/147525536-516c8710-1051-4875-b244-951b736ebec1.png)](https://user-images.githubusercontent.com/19222354/147525536-516c8710-1051-4875-b244-951b736ebec1.png)

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

[](#installation)

### First

[](#first)

```
    $ composer require lazywe/lazy-admin -vvv
```

### Second

[](#second)

- 修改config/auth.php

```
    // guards 新增如下
    'lazy-admin' => [
        'driver'   => 'session',
        'provider' => 'lazy-admin',
    ]

    // providers新增如下
    'lazy-admin' => [
        'driver' => 'eloquent',
        'model'  => Lazy\Admin\Models\AdminUser::class
    ]

```

- 注意

> 若mysql版本小于5.7.7 需要修改AppServiceProvider
>
> 新增如下
>
> use Illuminate\\Support\\ServiceProvider;
>
> boot方法新增如下
>
> Schema::defaultStringLength(191);
>
> **注意修改数据库配置**

### Third

[](#third)

- 生成配置文件命令如下

```
    $ php7 artisan lazy-admin:install
```

- 若自定义connection 可修改config/lazy-admin.conf 文件中的 connection
- 生成数据库命令如下

```
    $ php7 artisan lazy-admin:db
```

Usage
=====

[](#usage)

- 打开地址
- 用户名
- 密码 123456
- 注意：
- 后台入口前缀可以更改`lazy-admin.prefix`
- 所有后台路由需要使用`route()`方法，否则后台路由 `前缀` 可能无法动态更换

新功能的路由规则
--------

[](#新功能的路由规则)

- 权限验证中间件 lazy-admin
- 注意：所有需要权限验证的路由需要使用`lazy-admin`中间件，否则...
- 参考：App\\Providers\\RouteServiceProvider::class 文件新增如下

```
