用户配置转移

This commit is contained in:
2022-11-01 16:39:45 +08:00
parent 719a9ff89d
commit 87e650b2f1
14 changed files with 461 additions and 33 deletions

View File

@@ -0,0 +1,21 @@
<?php
namespace App\Models;
use App\Models\Traits\BelongsToUser;
class UserSetting extends Model
{
use BelongsToUser;
protected $primaryKey = 'user_id';
protected static function boot()
{
parent::boot();
self::creating(function ($model) {
$model->secret_key = app('pragmarx.google2fa')->generateSecretKey();
});
}
}