/** * Update the specified timeslot in storage. * * @param int $id * @return Response */ public function update($id) { $timeslot = Timeslot::findOrFail($id); $validator = Validator::make($data = Input::all(), Timeslot::$rules); if ($validator->fails()) { return Redirect::back()->withErrors($validator)->withInput(); } $timeslot->update($data); return Redirect::route('timeslots.index'); }
/** * Update the specified resource in storage. * * @param int $id * @return Response */ public function update($id) { $opt = Opt::findOrFail($id); $validator = Validator::make($data = Input::all(), Opt::$rules); if ($validator->fails()) { return Redirect::back()->withErrors($validator)->withInput(); } $data['time'] = Timeslot::findOrFail($data['timeslot_id'])->slot; if (Input::get('status') == '3' || Input::get('status') == '4' || Input::get('status') == '5') { $data['time'] = null; } $opt->update($data); return Redirect::route('opt.index'); }