willvrd / vuser-module
用户模块 - VGreen 应用
dev-master
2020-09-06 01:28 UTC
Requires
- php: >=7.0.0
- composer/installers: ~1.0
- laravel/passport: ~9.1
- laravel/ui: ~2.0
- spatie/laravel-permission: ~3.13
- willvrd/vcore-module: dev-master
- willvrd/vgreen-installer: *
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