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()
    {
        $videos = Video::published()->orderBy('id' , 'desc');
        if ( request()->has('search') && request()->get('search') != '' ) {
            $videos = $videos->where('name' , 'like' , "%".request()->get('search')."%");
        }
        $videos = $videos->paginate(30);
        return view('home', compact('videos'));
    }
public function index ( ) { $ videos = Video :: published ( ) -> orderBy ( 'id' , 'desc' ) ; if ( request ( ) -> has ( 'search' ) && request ( ) -> get ( 'search' ) != '' ) { $ videos = $ videos -> where ( 'name' , 'like' , " % " . request ( ) -> get ( 'search' ) . " % " ) ; } $ videos = $ videos -> paginate ( 30 ) ; return view ( 'home' , compact ( 'videos' ) ) ; }
Show the application dashboard.
Show the application dashboard .