title: Laravel php find number between in switch case
body: <p>User input can be two values, from <code>x</code> to <code>y</code>
  Now I want to search between user entries.</p>
  
  <p>For example user input are:</p>
  
  <blockquote>
    <p>from 55 to 90</p>
  </blockquote>
  
  <p>Now in html select like this:</p>
  
  <pre><code>&lt;select&gt;
    &lt;option value="1"&gt;From 5 to 50&lt;/option&gt;
    &lt;option value="2"&gt;From 50 to 85&lt;/option&gt;
    &lt;option value="3"&gt;From 85to 110&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>And in controller:</p>
  
  <pre><code>if($request-&gt;meter){
  switch ($request-&gt;meter) {
  case 1:
      $query-&gt;where([
          ['meterfrom', '&gt;=', '5'],
          ['meterto', '&lt;=', '50']
      ]);
      break;
  case 2:
      $query-&gt;where([
          ['meterfrom', '&gt;=', '50'],
          ['meterto', '&lt;=', '85']
      ]);
      break;
  }
  case 3:
      $query-&gt;where([
          ['meterfrom', '&gt;=', '85'],
          ['meterto', '&lt;=', '110']
      ]);
      break;
  }
  }
  </code></pre>
  
  <p>By this user input, my search return nothing, except those user that has data like (5-50) or (50-85) or (85-110) if user submit entry with (55-90) search can not find it, due to my switch case probably, but I wondering how to solve this? any idea or new logic to pass this?</p>
  
  <hr>
  
  <p><strong>Edit:</strong> This case about house area meter, user can enter form x meter, to y meter, for example 55 meter to 90 meter, right? now in front, I have search page, you see select option, I want to search house for example, from 5 to 50 meter or etc.. but one of user entered 55 to 90, but search by this logic can not find it.</p>