app/Http/Controllers/admin/CustomerController.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=[];
        $name = request()->cli_name;
        if($name){
            $where[] = ['cli_name','like',"%$name%"];
        }
        $con_name = request()->con_name;
        if($con_name){
            $where[] = ['con_name','like',"%$con_name%"];
        }
        $date = request()->date;
        if($date){
            $where[] = ['date','like',"%$date%"];
        }
        $data = CustomerModel::where($where)->paginate(2);
        $query = request()->all();
        return view('admin/customer/index',['data'=>$data,'query'=>$query]);
    }
public function index ( ) { $ where = [ ] ; $ name = request ( ) -> cli_name ; if ( $ name ) { $ where [ ] = [ 'cli_name' , 'like' , " % $ name % " ] ; } $ con_name = request ( ) -> con_name ; if ( $ con_name ) { $ where [ ] = [ 'con_name' , 'like' , " % $ con_name % " ] ; } $ date = request ( ) -> date ; if ( $ date ) { $ where [ ] = [ 'date' , 'like' , " % $ date % " ] ; } $ data = CustomerModel :: where ( $ where ) -> paginate ( 2 ) ; $ query = request ( ) -> all ( ) ; return view ( 'admin/customer/index' , [ 'data' => $ data , 'query' => $ query ] ) ; }
Display a listing of the resource.
Display a listing of the resource .