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