/**
  * Update the specified PointPrice in storage.
  * PUT/PATCH /pointPrices/{id}
  *
  * @param  int              $id
  * @param Request $request
  *
  * @return Response
  */
 public function update($id, Request $request)
 {
     $input = $request->all();
     /** @var PointPrice $pointPrice */
     $pointPrice = $this->pointPriceRepository->apiFindOrFail($id);
     $result = $this->pointPriceRepository->updateRich($input, $id);
     $pointPrice = $pointPrice->fresh();
     return $this->sendResponse($pointPrice->toArray(), "PointPrice updated successfully");
 }
Exemplo n.º 2
0
 /**
  * Update the specified PointPrice in storage.
  *
  * @param  int              $id
  * @param UpdatePointPriceRequest $request
  *
  * @return Response
  */
 public function update($id, UpdatePointPriceRequest $request)
 {
     $pointPrice = $this->pointPriceRepository->find($id);
     if (empty($pointPrice)) {
         Flash::error('PointPrice not found');
         return redirect(route('pointPrices.index'));
     }
     $this->pointPriceRepository->updateRich($request->all(), $id);
     Flash::success('PointPrice updated successfully.');
     return redirect(route('pointPrices.index'));
 }