'boolean', ]; public function subscriber(): MorphTo { return $this->morphTo(); } /** * Notes : 更新密钥 * * @Date : 2022/11/30 20:51 * @Author : */ public function upgrade() { $google2fa = app('pragmarx.google2fa'); $this->secret = $google2fa->generateSecretKey(32); $this->save(); } /** * Notes : 验证 * * @Date : 2022/11/30 20:49 * @Author : * @param string $value * @return bool */ public function verify(string $value): bool { $google2fa = app('pragmarx.google2fa'); return $google2fa->verifyGoogle2FA($this->secret, $value); } }