moc-solucoes / laravel-auth
Laravel框架的认证模块。
Requires
- laravel/socialite: >=5.0
- moc-solucoes/laravel-core: dev-master
This package is auto-updated.
Last update: 2024-09-06 21:00:19 UTC
README
关于认证模块
认证模块是Laravel框架的一个模块,具有以下功能:
- 登录、注销、注册、密码恢复
- 权限引擎
- 用户CRUD
- 权限(角色)CRUD
- 个人资料CRUD
本模块为私有,仅限在MOC Solutions使用。
依赖关系
唯一的依赖是一个模块 moc-solutions/laravel-core
(自动安装)
如何安装
-
步骤 1 - 使用命令 composer require
moc-solutions/laravel-auth
-
步骤 2 - 编辑文件
config/app.php
中的数组providers
,添加以下行:
\MOCSolutions\Auth\AppServiceProvider::class,
\MOCSolutions\Core\AppServiceProvider::class,
-
步骤 3 - 编辑文件
config/auth.php
中的数组providers.users
,更改模型:
'model' => \APP\User::class,
修改为'model' => \MOCSolutions\Auth\Models\Usuario::class,
-
步骤 4 - 使用命令
php artisan vendor:publish
,在Auth Provider
之后选择第一个Core Provider
。 -
步骤 5 - 将以下视图文件添加到菜单中:示例文件
resources/views/shared/_able-menu.blade.php
和resources/views/shared/_able-menu-externo.blade.php
-
步骤 6 - 编辑文件
app/Http/Kernel.php
中的数组$routeMiddleware
,添加以下行:
'permission' => \MOCSolutions\Auth\Middleware\Permission::class,
'authenticate' => \MOCSolutions\Auth\Middleware\Authenticate::class,
-
步骤 7 - 编辑文件
app/Http/Middleware/VerifyCsrfToken.php
中的数组$except
,添加以下行:
'auth/admin/api/*'
-
步骤 8 - 使用命令
php artisan migrate
执行迁移 -
步骤 9 - 使用命令
php artisan db:seed --class=SeedAuthSeeder
执行种子以创建初始用户和权限 -
步骤 10 - 将以下示例模型文件复制到您的项目中的
app/Http/Models/Auth
目录:示例模型。
示例模型文件 示例模型。
示例菜单 示例菜单。
许可证
本库在AGPL-3.0许可证下发布。
安全漏洞
如果您在Laravel Auth中发现安全漏洞,请通过contato@mocsolucoes.com.br发送电子邮件给MOC Soluções。所有安全漏洞都将得到及时解决。
维护者
本库由MOC SOLUÇÕES维护。