用户配置转移
This commit is contained in:
21
app/Models/UserSetting.php
Normal file
21
app/Models/UserSetting.php
Normal 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();
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user