/** * Display the specified Post by Category. * * @param int $id * @return Response */ public function category($slug) { $category = Category::where('slug', '=', $slug)->first(); $posts = Post::where('category_id', '=', $category->id)->get(); return $posts; }