app/Http/Controllers/admin/Client.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()
    {
        $where=[];
            $cli_name=request()->cli_name;
            if($cli_name){
                $where[]=['cli_name','like',"%$cli_name%"];
            }
            $cli_encode=request()->cli_encode;
            if($cli_encode){
                $where[]=['cli_encode','=',"$cli_encode"];
            }
            $area=request()->area;
            if($area){
                $where[]=['area','=',"$area"];
            }
            $private=request()->private;
            if($private){
                $where[]=['private','=',"$private"];
            }
            $type=request()->type;
            if($type){
                $where[]=['type','=',"$type"];
            }
            $sales=request()->sales;
            if($sales){
                $where[]=['sales','=',"$sales"];
            }
            $enterprise=request()->enterprise;
            if($enterprise){
                $where[]=['enterprise','=',"$enterprise"];
            }
            $industry=request()->industry;
            if($industry){
                $where[]=['industry','=',"$industry"];
            }
        $res=cli::join('users','client.user_id','=','users.user_id')->where($where)->paginate(3);
        $query=request()->all();
        return view('admin.client.index',['res'=>$res,'query'=>$query]);
    }
public function index ( ) { $ where = [ ] ; $ cli_name = request ( ) -> cli_name ; if ( $ cli_name ) { $ where [ ] = [ 'cli_name' , 'like' , " % $ cli_name % " ] ; } $ cli_encode = request ( ) -> cli_encode ; if ( $ cli_encode ) { $ where [ ] = [ 'cli_encode' , '=' , " $ cli_encode " ] ; } $ area = request ( ) -> area ; if ( $ area ) { $ where [ ] = [ 'area' , '=' , " $ area " ] ; } $ private = request ( ) -> private ; if ( $ private ) { $ where [ ] = [ 'private' , '=' , " $ private " ] ; } $ type = request ( ) -> type ; if ( $ type ) { $ where [ ] = [ 'type' , '=' , " $ type " ] ; } $ sales = request ( ) -> sales ; if ( $ sales ) { $ where [ ] = [ 'sales' , '=' , " $ sales " ] ; } $ enterprise = request ( ) -> enterprise ; if ( $ enterprise ) { $ where [ ] = [ 'enterprise' , '=' , " $ enterprise " ] ; } $ industry = request ( ) -> industry ; if ( $ industry ) { $ where [ ] = [ 'industry' , '=' , " $ industry " ] ; } $ res = cli :: join ( 'users' , 'client.user_id' , '=' , 'users.user_id' ) -> where ( $ where ) -> paginate ( 3 ) ; $ query = request ( ) -> all ( ) ; return view ( 'admin.client.index' , [ 'res' => $ res , 'query' => $ query ] ) ; }
Display a listing of the resource.
Display a listing of the resource .