title: How to create date to date search query in laravel
body: <p>i try to create data search query in laravel. but my script not working. This code works for me but I can't search for specific date to date.</p>
  <p>my controller code</p>
  <pre><code>    function mamla_search_data(Request $data){
  
      $mamla_number = $data-&gt;mamla_number;
      $date1 = $data-&gt;date1;
      $date2 = $data-&gt;date2;
  
      if(!empty($mamla_number)){
          $search[0] = ['mamla_number', 'like', '%'.$mamla_number.'%'];
      }
  
      if(!empty($date1) &amp;&amp; !empty($date2)){
          $search[2] =['input_date', '&gt;=', '%'.$date1.'%'];
          $search[3] =['input_date', '&lt;=', '%'.$date2.'%'];
      }
  
      if(isset($search)){
          $mamla_data = DB::table('mamla_info')-&gt;
          where('mamla_status', 'active')-&gt;
          where('mamla_input_status', 'complete')-&gt;
          where($search)-&gt;
          get();
          $search_count = $mamla_data-&gt;count();
          return view('search_view.mamla_search',
                      compact(
                          'mamla_data',
                          'data',
                          'search_count'
                      ));
      }
      else{return view('search_view.mamla_search');}
  }
  </code></pre>