title: Laravel 5.6 - GroupBy is not working
body: <p>I have tried it in several ways but it doesn't work (seems like ignoring it). So what I tried:</p>
  
  <pre><code>$user-&gt;notes()-&gt;groupBy('title')-&gt;get();
  </code></pre>
  
  <p>Above way completely ignores groupBy and just returns collection of notes.</p>
  
  <pre><code>Note::where('user_id', $user-&gt;id)-&gt;groupBy('title')-&gt;get();
  </code></pre>
  
  <p>Exactly same output with this one too.</p>
  
  <hr>
  
  <p>In my <code>database.php</code>, the database is set to <code>'strict' =&gt; false</code></p>
  
  <hr>
  
  <p>I have also tried using raw db query, it returns it in a weird format (returns 1 row for each title when I use groupBy)</p>
  
  <pre><code>DB::table('notes')-&gt;where('user_id', $user-&gt;id)-&gt;groupBy('title')-&gt;get();
  </code></pre>
  
  <hr>
  
  <p>I have seen many people facing this issue however none of the suggested ways  (above) solved the issue.</p>
  
  <p>I can achieve what I want with using <code>collection-&gt;each(function ($note) {...} )</code>, however while there is groupBy to make achieve this easily with 1 line, why the heavy work..</p>
  
  <p>Does anyone has any idea why it doesn't work?</p>