title: how to make laravel query builder like codeigniter active record
body: <p>I have a problem with Laravel 4 query builder, i want make a re-usable method</p>
  
  <pre><code>public function getData($where=array())
  {
      // $where = array('city' =&gt; 'jakarta', 'age' =&gt; '25');
      return User::where($where)-&gt;get();
  
      // this will produce an error, because i think laravel didn't support it
  }
  </code></pre>
  
  <p>In CodeIgniter it easy to passing array to active record :</p>
  
  <pre><code>public function getData($where=array())
  {
      $rs = $this-&gt;db-&gt;where($where)-&gt;from('user')-&gt;get();
  
      return $rs-&gt;result();
  }
  
  // it will produce :
  // SELECT * FROM user WHERE city = 'jakarta' AND age = '25'
  </code></pre>
  
  <p>Any idea how to have it on Laravel 4 query builder? I have googling but not find any answer. Thanks before.</p>