public function update_schedule($display_room = null) { if (Input::has('timeslots')) { $formvalues = Input::all(); $timeslots = $formvalues['timeslots']; //Here we assign presentations to timeslots foreach ($timeslots as $timeslot) { if (Input::has($timeslot)) { foreach ($formvalues[$timeslot] as $identifier) { $presentation = Presentation::findOrFail(explode('_', $identifier)[1]); $presentation->timeslot = $timeslot; $presentation->save(); } } //Here we 'unassign' presentations that were dropped back in the //unnasigned box if (Input::has('drag-elements')) { foreach ($formvalues['drag-elements'] as $identifier) { $presentation = Presentation::findOrFail(explode('_', $identifier)[1]); $presentation->timeslot = null; $presentation->save(); } } } } return redirect()->route('timeslot.show', compact('display_room')); }
public function save_comment($id, Request $request) { $comments = $request->all(); $presentation = Presentation::findOrFail($id); $presentation->status = 'D'; $presentation->comments = $comments['comments']; $presentation->save(); flash()->success('Your comments have being saved'); return redirect()->route('presentation.status', 'pending'); }