with([ 'pageTitle' => trans('dashboard.team.profile').' - '.trans('dashboard.dashboard'), ]); } /** * Updates the current user. * * @return \Illuminate\View\View */ public function postUser() { $items = Binput::all(); $enable2FA = (bool) array_pull($items, 'google2fa'); // Let's enable/disable auth $authSecret = $enable2FA && ! Auth::user()->hasEnabled2FA ? Google2FA::generateSecretKey() : ''; $items['google_2fa_secret'] = $authSecret; $updated = Auth::user()->update($items); return Redirect::back()->with('updated', $updated); } /** * Regenerates the users API key. * * @return \Illuminate\View\View */ public function regenerateApiKey(User $user) { $user->api_key = User::generateApiKey(); $user->save(); return Redirect::back(); } }