/** * Display the specified resource. * * @param int $id * @return Response */ public function show(News $news) { $news->increment('dibaca'); $comments = Comments::orderBy('created_at', 'DESC')->get()->where('news_id', $news->id); $sidebar = $news->orderBy('dibaca', 'DESC')->limit(5)->get(); $otherposts = News::orderBy('created_at', 'DESC')->where('kategori_id', $news->kategori_id)->limit(3)->get(); return view('sowindows.show', compact(['news', 'otherposts', 'comments', 'sidebar'])); }