ScoLib / admin1

基于Laravel5.3的后台

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ScoAdmin

StyleCI Latest Stable Version Total Downloads Latest Unstable Version License

Open your config/app.php and add the following to the providers array:

Sco\Admin\Providers\AdminServiceProvider::class,
Zizaco\Entrust\EntrustServiceProvider::class,

In the same config/app.php and add the following to the aliases array:

'Entrust' => Zizaco\Entrust\EntrustFacade::class,
php artisan vendor:publish --provider="Sco\Admin\Providers\AdminServiceProvider"
php artisan migrate
php artisan db:seed --class=AdminTableSeeder

auth.php

    // 增加guard
    'guards' => [
        ......
        'admin' => [
            'driver' => 'session',
            'provider' => 'admin',
        ],
    ],
    
    // 增加 providers
    'providers' => [
        ......

        'admin' => [
            'driver' => 'eloquent',
            'model' => App\User::class,
        ],
    ],

如果guard名字不是“admin”,则config/scoadmin.php中的guard也需要修改

User Model引入EntrustUserTrait

use Sco\Admin\Traits\AdminUserTrait;
use Zizaco\Entrust\Traits\EntrustUserTrait;

class User
{
    use EntrustUserTrait, AdminUserTrait;
}

About

基于Laravel5.3的后台

License:Apache License 2.0


Languages

Language:PHP 100.0%