title: Laravel 5 / Eloquent - Handling Array Parameters in Dynamic Where Method Input
body: <p>I have a repository function that gets data by using:</p>
  
  <pre><code>public function get($request){
  
      return User::where($request)-&gt;get();    
  
  }
  </code></pre>
  
  <p>where the <code>$request</code> array is dynamic.  The above works well as long as I pass in regular key value pairs:</p>
  
  <pre><code>$request = array(
      'name' =&gt; 'mike',
      'age' =&gt; 45
  );
  </code></pre>
  
  <p>The above translates to this SQL:</p>
  
  <pre><code>SELECT * 
  FROM users
  WHERE name = 'mike' AND age = 45;
  </code></pre>
  
  <p>Every once in a while, I would like to pass in an array as one of the properties for <code>$request</code>:</p>
  
  <pre><code>$request = array(
      'name' =&gt; 'mike',
      'age' =&gt; array(45, 46)
  )
  </code></pre>
  
  <p>and have it translate into the following SQL:</p>
  
  <pre><code>SELECT *
  FROM users
  WHERE name = 'mike' AND age IN(45, 46);
  </code></pre>
  
  <p>Any properties set as an array in <code>$request</code> should be treated as a <code>where in</code> statement as opposed to a vanilla <code>where</code> statement.</p>
  
  <p>How would I do this?</p>