22 lines
378 B
PHP
22 lines
378 B
PHP
<?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();
|
|
});
|
|
}
|
|
}
|