/** * Display the home page. * * @param int $id category's id * */ public function subject($id) { $tag = Tag::findorfail($id); $articles = $tag->articles()->select('article_id', 'title', 'intro', 'page_image')->where('is_checked', true)->published()->orderBy('published_at', 'desc')->paginate(10); return view('front.category')->with('articles', $articles); }