/** * View user profile. * * @return \Illuminate\View\View */ public function index() { $user = Auth::user(); $code = $this->google2fa->generateSecretKey(); if ($user->has_two_factor_authentication || old('google_code')) { $code = old('google_code', $user->google2fa_secret); } $img = $this->google2fa->getQRCodeGoogleUrl('Deployer', $user->email, $code); return view('user.profile', ['google_2fa_url' => $img, 'google_2fa_code' => $code, 'title' => Lang::get('users.update_profile')]); }