app/Http/Controllers/HomeController.php
/**
     * Show the application dashboard.
     *
     * @return \Illuminate\Contracts\Support\Renderable
     */
Show the application dashboard.
@return \Illuminate\Contracts\Support\Renderable
Show the application dashboard . @return \ Illuminate \ Contracts \ Support \ Renderable
public function index()
    {
        $home_categories = VideoCategory::where('home_flag', '1')
                                    ->where('status', '1')
                                    ->orderBy('title', 'asc')
                                    ->get();
        $videos = Video::where('status', '1')
                        ->orderBy('id', 'desc')
                        ->take(100)
                        ->get();
        $featureds = Video::where('featured', '1')
                        ->where('status', '1')
                        ->orderBy('id', 'desc')
                        ->take(16)
                        ->get();
        $latests = Video::where('status', '1')
                        ->orderBy('id', 'desc')
                        ->take(6)
                        ->get();
        $most_views = Video::where('status', '1')
                            ->orderBy('views', 'desc')
                            ->orderBy('id', 'desc')
                            ->take(6)
                            ->get();
        $most_likes = Video::where('status', '1')
                            ->orderBy('like', 'desc')
                            ->orderBy('id', 'desc')
                            ->take(6)
                            ->get();
        return view('index', compact('home_categories', 'videos', 'featureds', 'latests', 'most_views', 'most_likes'));
    }
public function index ( ) { $ home_categories = VideoCategory :: where ( 'home_flag' , '1' ) -> where ( 'status' , '1' ) -> orderBy ( 'title' , 'asc' ) -> get ( ) ; $ videos = Video :: where ( 'status' , '1' ) -> orderBy ( 'id' , 'desc' ) -> take ( 100 ) -> get ( ) ; $ featureds = Video :: where ( 'featured' , '1' ) -> where ( 'status' , '1' ) -> orderBy ( 'id' , 'desc' ) -> take ( 16 ) -> get ( ) ; $ latests = Video :: where ( 'status' , '1' ) -> orderBy ( 'id' , 'desc' ) -> take ( 6 ) -> get ( ) ; $ most_views = Video :: where ( 'status' , '1' ) -> orderBy ( 'views' , 'desc' ) -> orderBy ( 'id' , 'desc' ) -> take ( 6 ) -> get ( ) ; $ most_likes = Video :: where ( 'status' , '1' ) -> orderBy ( 'like' , 'desc' ) -> orderBy ( 'id' , 'desc' ) -> take ( 6 ) -> get ( ) ; return view ( 'index' , compact ( 'home_categories' , 'videos' , 'featureds' , 'latests' , 'most_views' , 'most_likes' ) ) ; }
Show the application dashboard.
Show the application dashboard .
// Home Categories // Videos // Featured // Latests // MostViewed // MostLiked