public function postCreate(Request $request){ if($request->has('new_teg')){ $teg = new Teg; $teg->name = $request->input('new_teg'); $teg->save(); return view('topics.form',[ 'message' => 'Метка создана', 'teg' => $teg ]); } else{ return view('topics.form',[ 'teg' => Teg::find($request->input('teg')) ]); } }
public function show($id){ $teg= Teg::find($id); return view('teg.show',[ 'teg' => $teg, ]); }
public function getTeg($id){ return view('questions.index',[ 'questions'=>Teg::find($id)->questions()->paginate(), 'titlePage' => Teg::find($id)->name ]); }