app/Http/Controllers/GaleriController.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()
    {
      $galeri = Galeri::orderBy('updated_at', 'desc')
                        ->where('status', 2)
                        ->paginate(9);
      $countBerita = Berita::where('status', 2)
                  ->count();
      $countGaleri = Galeri::where('status', 2)
                  ->count();
      $countSantri = Santri::where('status', 2)
                  ->count();
      $countVideo = Video::where('status', 2)
                  ->count();
      $recentBerita = Berita::where('status', 2)
                  ->orderBy('updated_at', 'desc')
                  ->take(4)
                  ->get();
      return view('content.galeri.0index', compact(
                                                    'galeri',
                                                    'countBerita',
                                                    'countGaleri',
                                                    'countSantri',
                                                    'countVideo',
                                                    'recentBerita',
                                                  ));
    }
public function index ( ) { $ galeri = Galeri :: orderBy ( 'updated_at' , 'desc' ) -> where ( 'status' , 2 ) -> paginate ( 9 ) ; $ countBerita = Berita :: where ( 'status' , 2 ) -> count ( ) ; $ countGaleri = Galeri :: where ( 'status' , 2 ) -> count ( ) ; $ countSantri = Santri :: where ( 'status' , 2 ) -> count ( ) ; $ countVideo = Video :: where ( 'status' , 2 ) -> count ( ) ; $ recentBerita = Berita :: where ( 'status' , 2 ) -> orderBy ( 'updated_at' , 'desc' ) -> take ( 4 ) -> get ( ) ; return view ( 'content.galeri.0index' , compact ( 'galeri' , 'countBerita' , 'countGaleri' , 'countSantri' , 'countVideo' , 'recentBerita' , ) ) ; }
Display a listing of the resource.
Display a listing of the resource .