/** * Update the specified resource in storage. * * @param int $id * @return Response */ public function update($id) { //Validation $rules = array('lot_no' => 'required'); $validator = Validator::make(Input::all(), $rules); if ($validator->fails()) { return Redirect::to('lot/' . $id . '/edit')->withErrors($validator)->withInput(); } else { // Add $lot = Lot::findOrFail($id); $lot->lot_no = Input::get('lot_no'); $lot->description = Input::get('description'); $lot->expiry = Input::get('expiry'); $lot->save(); $url = session('SOURCE_URL'); return Redirect::to($url)->with('message', trans('messages.successfully-updated-lot')); } }