/** * Update the specified Profile in storage. * PUT/PATCH /profiles/{id} * * @param int $id * @param Request $request * * @return Response */ public function update($id, Request $request) { $input = $request->all(); /** @var Profile $profile */ $profile = $this->profileRepository->apiFindOrFail($id); $result = $this->profileRepository->update($input, $id); $profile = $profile->fresh(); return $this->sendResponse($profile->toArray(), "Profile updated successfully"); }
/** * Update the specified Profile in storage. * * @param int $id * @param UpdateProfileRequest $request * * @return Response */ public function update($id, UpdateProfileRequest $request) { $profile = $this->profileRepository->find($id); if (empty($profile)) { Flash::error('Profile not found'); return redirect(route('profiles.index')); } $profile = $this->profileRepository->update($request->all(), $id); Flash::success('Profile updated successfully.'); return redirect(route('profiles.index')); }