/** * Update the logged in user's profile. * * @return \Illuminate\Http\JsonResponse */ public function updateProfile() { try { $this->users->updateCurrentProfile($this->input()); return $this->jsonResponse(['user' => $this->users->getCurrentUser()]); } catch (ValidationException $e) { return $this->error($e->getMessageBag()); } }
/** * Update the logged in user's profile. * * @return \Illuminate\Http\RedirectResponse */ public function updateProfile() { $redirect = $this->redirect('profile'); try { $this->users->updateCurrentProfile($this->input()); return $redirect->with('success', Lang::get('c::user.profile-update-success')); } catch (ValidationException $e) { return $redirect->withErrors($e); } }