app/Http/Controllers/Admin/front/TeamController.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()
    {
        $teams = Team::orderBy('id');
        $this->search = [
            'name' =>\request()->get('name') ,
        ];
        if ($this->search['name']){
            $teams->where('name' , 'like' , "%{$this->search['name']}%");
        }
        $teams=$teams->paginate(10)->appends($this->search);
        return view('frontend.team.index')->with('teams',$teams);
    }
public function index ( ) { $ teams = Team :: orderBy ( 'id' ) ; $ this -> search = [ 'name' => \ request ( ) -> get ( 'name' ) , ] ; if ( $ this -> search [ 'name' ] ) { $ teams -> where ( 'name' , 'like' , " % { $ this -> search [ 'name' ] } % " ) ; } $ teams = $ teams -> paginate ( 10 ) -> appends ( $ this -> search ) ; return view ( 'frontend.team.index' ) -> with ( 'teams' , $ teams ) ; }
Display a listing of the resource.
Display a listing of the resource .