type == Category::TYPE_SHOW) { if ($category->relations) { return route('article.show', $category->relations); } } $parent = getTopCate($category->id); $template = array_flip(config('haai.category')); if (isset($template[$category->id])) { return view('category.' . $template[$category->id], compact('category', 'parent')); } return redirect(route('category.list', $category)); } //显示文章列表 public function list(Category $category) { $articles = Article::where('category_id', $category->id)->where('status', 1)->paginate(); $parent = getTopCate($category->id); return view('category.list', compact('category', 'parent', 'articles')); } }