Example #1
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $categories = Category::article()->paginate(10);
     return view('backend.categories.index', compact('categories'));
 }
Example #2
0
 /**
  * Display the specified resource.
  *
  * @param string $slug
  * @return \Illuminate\Http\Response
  */
 public function show($slug)
 {
     $category = Category::article()->active()->where('slug', '=', $slug)->firstOrFail();
     $articles = Content::article()->active()->where('category_id', '=', $category['id'])->paginate(10);
     return view('frontend.categories.show', compact('category', 'articles'));
 }