/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id, Request $request) { $class = \Session('class'); $subject = \Session('subject'); $question = Question::find($id); if ($request->get('agree') == 1) { $question->delete(); return redirect()->to("questions?class={$class}&subject={$subject}")->with('message', '<p class="alert alert-success">Question Deleted</p>'); } return redirect('questions'); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy(Request $request, $id, $subjectId, $questionId) { $question = Question::find($questionId); if ($request->get('agree') == 1) { $question->delete(); return redirect()->route("classes.subjects.questions.index", [$id, $subjectId])->with('message', '<p class="alert alert-success">Question Deleted</p>'); } return redirect()->route("classes.subjects.questions.index", [$id, $subjectId]); }