public function destroy($question_id) { $json_request = array('status' => FALSE, 'responseText' => '', 'redirect' => FALSE); if (Request::ajax()) { Questions::where('id', $question_id)->delete(); $json_request['responseText'] = "Вопрос удален."; $json_request['status'] = TRUE; } else { return Redirect::back(); } return Response::json($json_request, 200); }