app/Http/Controllers/BeritaController.php
/**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
Display a listing of the resource.
@return \Illuminate\Http\Response
Display a listing of the resource . @return \ Illuminate \ Http \ Response
public function index(){
      $berita = Berita::orderBy('updated_at', 'desc')
                  ->where('status', 2)
                  ->paginate(5);
      $countBerita = Berita::where('status', 2)
                  ->count();
      $countGaleri = Galeri::where('status', 2)
                  ->count();
      $countSantri = Santri::where('status', 2)
                  ->count();
      $countVideo = Video::where('status', 2)
                  ->count();
      $recentSantri = Santri::where('status', 2)
                  ->orderBy('updated_at', 'desc')
                  ->take(4)
                  ->get();
      return view('content.berita.0index', compact(
                                                  'berita',
                                                  'countBerita',
                                                  'countGaleri',
                                                  'countSantri',
                                                  'countVideo',
                                                  'recentSantri',
                                                    ));
    }
public function index ( ) { $ berita = Berita :: orderBy ( 'updated_at' , 'desc' ) -> where ( 'status' , 2 ) -> paginate ( 5 ) ; $ countBerita = Berita :: where ( 'status' , 2 ) -> count ( ) ; $ countGaleri = Galeri :: where ( 'status' , 2 ) -> count ( ) ; $ countSantri = Santri :: where ( 'status' , 2 ) -> count ( ) ; $ countVideo = Video :: where ( 'status' , 2 ) -> count ( ) ; $ recentSantri = Santri :: where ( 'status' , 2 ) -> orderBy ( 'updated_at' , 'desc' ) -> take ( 4 ) -> get ( ) ; return view ( 'content.berita.0index' , compact ( 'berita' , 'countBerita' , 'countGaleri' , 'countSantri' , 'countVideo' , 'recentSantri' , ) ) ; }
Display a listing of the resource.
Display a listing of the resource .