/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function getEdit($id) { $question = Question::find($id); $questioncategories = QuestionCategory::all(); $questioncategory = $question->question_category_id; return view('admin.questions.edit', compact('question', 'questioncategories', 'questioncategory')); }
/** * Get question categories. * * @param GetQuestionCategoriesRequest $request * @return mixed */ public function getQuestionCategories(GetQuestionCategoriesRequest $request) { $response = new AjaxResponse(); $response->setSuccessMessage(trans('common.success')); $response->addExtraFields(['question_categories' => QuestionCategory::all()]); return response($response->get())->header('Content-Type', 'application/json'); }
/** * Show the form for creating a new resource. * * @return Response */ public function getCreate() { // Show the page $questioncategories = QuestionCategory::all(); return view('questions/create', compact('questioncategories')); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function getEdit($id) { $questioncategory = QuestionCategory::find($id); $questioncategories = QuestionCategory::all(); return view('admin.questioncategory.create_edit', compact('questioncategory', 'questioncategories')); }