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