sepehrcorefinity/google2fa-visanduma

v1.0.0 2024-06-01 06:09 UTC

This package is not auto-updated.

Last update: 2024-09-29 13:06:27 UTC


README

Laravel nova in-dashboard 2FA 安全功能

  1. 发布配置 & 迁移

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

];

  1. 在用户模型中使用 ProtectWith2FA 特性

使用 ProtectWith2FA

  1. 将 TwoFa 中间件添加到 nova 配置文件中

\Visanduma\NovaTwoFactor\Http\Middleware\TwoFa::class

  1. 在 Nova 服务提供者中注册 NovaTwoFactor 工具

new \Visanduma\NovaTwoFactor\NovaTwoFactor()

  1. 运行 php artisan migrate
  2. 完成!