sepehrcorefinity / google2fa-visanduma
Nova 双因素认证
v1.0.0
2024-06-01 06:09 UTC
Requires
- php: >=7.1.0
- bacon/bacon-qr-code: ^2.0
- pragmarx/google2fa-laravel: ^2.0
This package is not auto-updated.
Last update: 2024-09-29 13:06:27 UTC
README
Laravel nova in-dashboard 2FA 安全功能
- 发布配置 & 迁移
php artisan vendor:publish --provider="Visanduma\NovaTwoFactor\ToolServiceProvider"
根据需要更改配置
return [
'enabled' => env('NOVA_TWO_FA_ENABLE',true),
'user_table' => 'users',
'user_id_column' => 'id',
'user_model' => \App\Models\User::class
];
- 在用户模型中使用 ProtectWith2FA 特性
使用 ProtectWith2FA
- 将 TwoFa 中间件添加到 nova 配置文件中
\Visanduma\NovaTwoFactor\Http\Middleware\TwoFa::class
- 在 Nova 服务提供者中注册 NovaTwoFactor 工具
new \Visanduma\NovaTwoFactor\NovaTwoFactor()
- 运行 php artisan migrate
- 完成!