ethan-xy / ethan-laravel-admin
v1.0.1
2022-09-16 02:01 UTC
Requires
- php: ^7.3|^8.0
- laravel/sanctum: ^2.11
- laravel/tinker: ^2.5
- predis/predis: ^1.1
- spatie/laravel-permission: ^5.4
- tucker-eric/eloquentfilter: ^3.0
This package is auto-updated.
Last update: 2024-10-16 06:51:35 UTC
README
ETHAN-LARAVEL-ADMIN 是基于 Laravel 开发的服务端, 并提供基于 Vue3、 Element Plus、Vite 构建的后台管理模板 ETHAN-VUE-ADMIN
要求
- Laravel >= 8.0.0
- PHP ^7.3|^8.0
特性
- laravel8+vue3前后端分离
- 基于 laravel-permission 权限管理
- 基于 sanctum 鉴权
- 角色,权限,用户,菜单管理等API
Demo
账号:test 密码:123456
安装
需要安装laravel,并配置好数据库
composer require ethan-xy/ethan-laravel-admin
发布:
php artisan ethan:install
执行数据迁移
php artisan migrate
数据填充
php artisan db:seed --class="\Ethan\LaravelAdmin\Database\DatabaseSeeder"
修改
修改config/auth.php,增加配置
'auth_provider' => [
'admin' => [
'model' => \Ethan\LaravelAdmin\Models\AdminUser::class,
'login_fields' => [
'email',
'name'
]
],
'user' => [
...
]
]
修改 app/Http/Kernel.php :
class Kernel extends HttpKernel
{
protected $routeMiddleware = [
...
'ethan.permission' => \App\Http\Middleware\EthanAuthCanPermission::class,
];
protected $middlewareGroups = [
...
'api' => [
...
\Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
],
];
}
路由中间件
- auth:sanctum
- ethan.permission
依赖扩展包
- spatie/laravel-permission
- laravel/sanctum
- tucker-eric/eloquentfilter