/** * Display a listing of the resource. * * @return Response */ public function index() { $categories = Category::latest('published_at')->published()->get(); return view('categories.index', compact('categories')); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { $quiz = Quiz::findOrFail($id); $cats = Category::latest('published_at')->published()->lists('title', 'id'); return View('quizzes.edit', compact('quiz', 'cats')); }