Example #1
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $categories = Category::latest('published_at')->published()->get();
     return view('categories.index', compact('categories'));
 }
Example #2
0
 /**
  * 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'));
 }