hasEnabledTwoFactorAuthentication(); $pending = $available && filled($user->two_factor_secret) && ! $enabled; return [ 'available' => $available, 'enabled' => $enabled, 'pending' => $pending, 'requiresPassword' => $user->hasPassword(), 'qrCodeDataUri' => $pending ? 'data:image/svg+xml;base64,'.base64_encode($user->twoFactorQrCodeSvg()) : null, 'secretKey' => $pending ? Fortify::currentEncrypter()->decrypt($user->two_factor_secret) : null, ]; } }