type == Category::TYPE_SHOW && $category->article_id) { return redirect("articles/" . $category->article_id); } else { $articles = $category->relations(Category::TYPE_ARTICLE)->paginate(); $parent = $category; if ($category->childrens->isEmpty()) { $parent = $category->parent; } $advert = Advert::where('category_id',73)->first(); return view('category.show', compact('articles', 'category', 'parent','advert')); } } }