1Route::get(/category/{slug});
2
3 public function postCategory($slug)
4 {
5 $posts = Post::where('slug', $slug)->get();
6
7 return view('front.posts.category', compact('posts'));
8 }
9
1 public function postCategory($id)
2 {
3 $posts = Post::where('category_id', $id)->get();
4
5 return view('front.posts.category', compact('posts'));
6 }
7