title: Laravel How to check if request is null that sent by datatable ajax
body: <p>I want to check if requests that using for filtering are null, so if null then show all data in datatable otherwise filter the results depend on the requested values</p>
  
  <p>here controller</p>
  
  <pre><code>  public function getCustomFilterData(Request $request)
    {
     $arrStart = explode("/", Input::get('start_date'));
      $arrEnd = explode("/", Input::get('end_date'));
      $start = Carbon::create($arrStart[2], $arrStart[0], $arrStart[1], 0, 0, 0);
      $end = Carbon::create($arrEnd[2], $arrEnd[0], $arrEnd[1], 23, 59, 59);
  
  $min = $request-&gt;start_amount;
    $max = $request-&gt;end_amount;
  
       $vendorTableName= with(new Vendors())-&gt;getTable();
     $categoryTableName= with(new Excategories())-&gt;getTable();
   $orders =Checks::select(["checks.*","vendors.vendor_name","excategories.category_name"])-&gt;Wherebetween('amount',[$min,$max])-&gt;between($start, $end)-&gt;leftJoin($vendorTableName,$vendorTableName.".vendor_id","=","checks.vendor_id")-&gt;leftJoin($categoryTableName,$categoryTableName.".category_id","=","checks.category_id");
  return Datatables::of($orders)-&gt;make( TRUE );
  }
  </code></pre>