public function destroy($id) { $overbooking = Overbooking::findOrFail($id); $overbooking->delete(); // Session::flash('flash_message', 'Task successfully deleted!'); return redirect()->route('tasks.index'); }
/** * Update the specified resource in storage. * * @param int $id * @return Response */ public function update($id, Request $request) { // condizioni di aggiornamento prenotazione di overbooking if (isset($_POST['overupdate'])) { $over = Overbooking::findOrFail($id); $input = $request->all(); $over->fill($input)->save(); // Session::flash('flash_message', 'Task successfully added!'); // return redirect()->back(); return redirect()->route('tasks.index'); } else { // condizioni di aggiornamento prenotazione $task = Task::findOrFail($id); $input = $request->all(); $task->fill($input)->save(); // Session::flash('flash_message', 'Task successfully added!'); // return redirect()->back(); return view('tasks.show')->withTask($task); } }