willvrd/vuser-module

用户模块 - VGreen 应用

维护者

详细信息

github.com/willvrd/Vuser

源代码

问题

安装: 1

依赖: 0

建议者: 0

安全: 0

星标: 0

关注者: 2

分支: 0

公开问题: 0

类型:vgreen-module

dev-master 2020-09-06 01:28 UTC

This package is auto-updated.

Last update: 2024-09-06 10:23:44 UTC


README

安装

composer require willvrd/vuser-module

步骤

1. Run authentication:
php artisan ui vue --auth
2. Run Migrations
php artisan migrate
3. Install Laravel Passport
php artisan passport:install
4. Go to config/auth.php
    - Set the driver option of the api authentication guard to passport
    - Change the model from provider to: Modules\Vuser\Entities\User::class,

5. Add the service provider in your config/app.php file:
'providers' => [
// ...
Spatie\Permission\PermissionServiceProvider::class,
];
6. Publish the migration and the config/permission.php config file 
php artisan vendor:publish --provider="Spatie\Permission\PermissionServiceProvider"
7. Go to config/permission.php
    - Change 'model_has_permissions' => 'user_has_permissions',  
    - Change 'model_has_roles' => 'user_has_roles', 
    - Change 'model_morph_key' => 'user_id',

8. Run Migrations
php artisan migrate
9. Run this command: 
php artisan user:role-permission:init

资产模块

1. cd Modules/Vuser
2. npm install
3. npm run dev
4. In your view add:
@section('scripts-modules')
    <script src="{{ mix('js/vuser.js') }}"></script>
@stop

端点

路由基础: https://yourhost.com/api/user/v1/

  • 用户

  • 认证

  • 角色

  • 权限

后端

### Pages

    Index:  http://mysite/en/backend/user/users
    name:   locale.admin.user.users.index

    Index:  http://mysite/en/backend/user/roles
    name:   locale.admin.user.roles.index