title: Error in laravel query builder
body: <p>My Laravel query builder return null:</p>
  
  <pre><code>    $country = DB::table('participate_company')
  
          -&gt;join('company', 'company.company_id', '=', 'participate_company.company_id')
          -&gt;join('country', 'country.country_id', '=', 'company', 'company.country_id')
          -&gt;join('competition', 'competition.competition_id', '=', 'participate_company.competition_id')
  
          -&gt;select('country.country_name', DB::raw('COUNT(company.country_id) as total'))
          -&gt;groupBy('company.country_id')
          -&gt;groupBy('country.country_name')
          -&gt;get();
  </code></pre>
  
  <p><b>Table design:</b></p>
  
  <p><b>1. Participate_company</b></p>
  
  <p>competition_id (pk/fk)<br>
  company_id (pk/fk)</p>
  
  <p><b>2. company </b></p>
  
  <p>company_id (pk) <br>
  company_name <br>
  country_id (fk)</p>
  
  <p><b>3. country</b></p>
  
  <p>country_id (pk) <br>
  country_name</p>
  
  <p><b>4. competition</b></p>
  
  <p>competition_id (pk)<br>
  competition_year</p>
  
  <p>I want to produce result of count distinct country based on competition year. For example competition year = 2012, country_name = England, count(total) = 20. But my current query produce null.</p>
  
  <p>SQLFiddle : <a href="http://sqlfiddle.com/#!9/a2092f/1" rel="nofollow noreferrer">http://sqlfiddle.com/#!9/a2092f/1</a></p>