/**
  * Update the specified IwomenPost in storage.
  * PUT/PATCH /iwomenPosts/{id}
  *
  * @param  int              $id
  * @param Request $request
  *
  * @return Response
  */
 public function update($id, Request $request)
 {
     $input = $request->all();
     /** @var IwomenPost $iwomenPost */
     $iwomenPost = $this->iwomenPostRepository->apiFindOrFail($id);
     $result = $this->iwomenPostRepository->updateRich($input, $id);
     $iwomenPost = $iwomenPost->fresh();
     return $this->sendResponse($iwomenPost->toArray(), "IwomenPost updated successfully");
 }
 /**
  * Update the specified IwomenPost in storage.
  *
  * @param  int              $id
  * @param UpdateIwomenPostRequest $request
  *
  * @return Response
  */
 public function update($id, UpdateIwomenPostRequest $request)
 {
     $iwomenPost = $this->iwomenPostRepository->find($id);
     if (empty($iwomenPost)) {
         Flash::error('IwomenPost not found');
         return redirect(route('iwomenPosts.index'));
     }
     $input = $request->all();
     if ($request->file('image')) {
         $image = $this->uploadImage($request->file('image'), '/posts_photo/');
         $input['image'] = $image['resize_url'][0];
     }
     if ($request->file('postUploadPersonImg')) {
         $image = $this->uploadImage($request->file('postUploadPersonImg'), '/posts_photo/');
         $input['postUploadPersonImg'] = $image['resize_url'][0];
     }
     if ($request->file('postUploadUserImgPath')) {
         $image = $this->uploadImage($request->file('postUploadUserImgPath'), '/posts_photo/');
         $input['postUploadUserImgPath'] = $image['resize_url'][0];
     }
     $this->iwomenPostRepository->updateRich($input, $id);
     Flash::success('IwomenPost updated successfully.');
     return redirect(route('iwomenPosts.index'));
 }