/** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { $answertypes = Answertype::lists('name', 'id'); return view('templates.create', compact('answertypes')); }
/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($question) { $answertypes = Answertype::lists('name', 'id'); $questionable_id = $question->questionable->id; $questionable_type = $question->questionable->type(); return view('questions.edit', compact('question', 'answertypes', 'questionable_id', 'questionable_type')); }