/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($_, $id) { $question = Question::findOrFail($id); $question->delete(); return json(1); }
/** * Store a newly created resource in storage. * * @return Response */ public function store($quizId, $questionId) { $question = Question::findOrFail($questionId); $question->options()->save(new Option(['option' => e(Input::get('option')), 'display_order' => Input::get('display_order')])); return json(1); }