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