orderBy('tanggal_informasi', 'desc') ->paginate(6); return view('user.berita', compact('berita')); } /** * Detail berita */ public function show($id) { $berita = Informasi::where('kategori_informasi', 'berita') ->where('id_informasi', $id) ->firstOrFail(); $recentBerita = Informasi::where('kategori_informasi', 'berita') ->where('id_informasi', '!=', $id) ->orderBy('tanggal_informasi', 'desc') ->limit(5) ->get(); return view('user.detail-berita', compact('berita', 'recentBerita')); } /** * Berita untuk hero slider */ public function hero() { $beritaHero = Informasi::where('kategori_informasi', 'berita') ->orderBy('tanggal_informasi', 'desc') ->take(3) ->get(); return view('user.index', compact('beritaHero')); } }