title: Laravel groupBy but keep other values
body: <p>I've been having trouble joining multiple results that I fetch, trying to avoid a separate for each to do this.</p>
  
  <p>Basically I have a table with translations for two languages.
  The table columns are:</p>
  
  <pre><code>id | service_id | name | slug | lang
  </code></pre>
  
  <p>Example inputs (same services just different translations): </p>
  
  <pre><code>service_id: 1, name: 'Igre', slug: 'igre', lang: 'hr'
  
  service_id: 1, name: 'Games', slug: 'games', lang: 'en'
  </code></pre>
  
  <p>Now I'm trying to join these rows based on <code>service_id</code> without losing or overwriting each others values. </p>
  
  <p>Example (what i want my output to be based on the two rows above): </p>
  
  <pre><code>service_id: 1, name_hr: 'Igre', name_en: 'Games', slug_hr: 'igre', slug_en: 'games'
  </code></pre>
  
  <p>Or something close to that, the main thing is to combine everything into one array field based on <code>id</code> without losing other data. I've tried using <code>groupBy()</code> but always end up with one value overwriting the other.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <pre><code>$service = Service::with(['subservice' =&gt; function($query){
          $query-&gt;leftJoin('subservice_translations', 'subservices.id', 'subservice_translations.subservice_id');
          $query-&gt;select('subservices.*', 'subservice_translations.name as name', 'subservice_translations.lang as lang');
      }])
      -&gt;join('service_translations', 'services.id', 'service_translations.service_id')
      -&gt;select('services.*', 'service_translations.name as name', 'service_translations.lang as lang')
      -&gt;where('services.id', $id)
      -&gt;orderByRaw("FIELD(lang , 'hr', 'en') ASC")
      -&gt;get();
  </code></pre>
  
  <p>This is my query currently. Both 'Services' and '<strong>Subservices</strong>' have translations. One '<strong>Service</strong>' can have multiple '<strong>Subservices</strong>' which also have translations. So if I input 5 '<strong>Subservices</strong>' for my '<strong>Service</strong>' I'm actually inputting 10 (5 in 'hr' and 5 in 'en'). I don't want my query result to have 10 results but 5 with the output as I said above in the example. </p>