/** * Update the specified resource in storage. * * @param int $id * @return Response */ public function update(Request $request, $id) { $validator = $this->validator($request->all()); if ($validator->fails()) { return redirect()->back()->withErrors($validator); } $start_time = Carbon::today(); $end_time = Carbon::today(); $start_time->hour = substr($request->input('start_time'), 0, 2); $start_time->minute = substr($request->input('start_time'), 3, 2); $end_time->hour = substr($request->input('end_time'), 0, 2); $end_time->minute = substr($request->input('end_time'), 3, 2); $waiterArea = WaiterArea::findorfail($id); $waiterArea->FK_area_id = $request->input('area'); $waiterArea->start_time = $start_time; $waiterArea->end_time = $end_time; $waiterArea->save(); return redirect()->back(); }