Files
zh-chat-server/app/Models/UserSetting.php
2022-11-01 16:39:45 +08:00

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();
});
}
}