Laravel-layui-admin是一个基于Laravel、Layui构建的基础后台管理系统。
要求最低支持laravel5.8,支持6.0安装首先安装laravel,并且确保你配置了正确的数据库连接。
composerrequiremoell/laravel-layui-admin然后运行下面的命令来发布资源和配置:
phpartisanlaravel-layui-admin:install在config/auth.php中添加相应的guards和providers,如下:
'guards'=>[...'admin'=>['driver'=>'session','provider'=>'admin']],'providers'=>[...'admin'=>['driver'=>'eloquent','model'=>\Moell\LayuiAdmin\Models\AdminUser::class,]],在 app/Http/Kernel.php 中$routeMiddleware属性添加路由中间admin.permission 和替换auth中间件:
classKernelextendsHttpKernel{protected$routeMiddleware=[//'auth'=>\App\Http\Middleware\Authenticate::class,'auth'=>\Moell\LayuiAdmin\Http\Middleware\Authenticate::class,...'admin.permission'=>\Moell\LayuiAdmin\Http\Middleware\Authenticate::class,];}执行数据迁移,数据填充
phpartisanmigratephpartisandb:seed--class="Moell\LayuiAdmin\Database\LayuiAdminTableSeeder"登录
url: https://localhost/admin/login
email: admin@gmail.com
password:secret
依赖开源软件LaravelLayuispatie/laravel-permission
评论