title: laravel grouping by multiple columns
body: <p>Im using laravel 5.2 and I want to group a table based on the value of two columns (configuration and type). So basically if two or more rows in the table have the same configuration and type they will be grouped.
  I've tried querying like this and its not working:</p>
  
  <pre><code> $groups = Model::where('active', 1)-&gt;get()-&gt;groupBy('type_id', 'configuration_id');
  </code></pre>
  
  <p>Any suggestions?</p>
  
  <p>EDIT: I think I'm using the wrong query. What I want to do is get the rows that have the same values in these two columns and have them grouped. Apparently group by is used to aggregate things e.g if I want a sum or something.</p>
  
  <p>EDIT 2: Actually the groupby here I'm using is not part of the query it is a helper function provided by laravel to use on collections see this <a href="https://laravel.com/docs/5.3/collections#method-groupby" rel="nofollow">link</a> Does anyone know if it groups by two feilds??</p>