title: Laravel hasmany relationship with withCount()
body: <p>Trying to display the count of the users table that belong to the company table I only get NULL while I can normally see the correct results while calling the relationship directly. Here is the display code:</p>
  
  <pre><code>@foreach($allCompanies as $theCompany)
  {{ $theCompany-&gt;getUser_count }}
  @endforeach
  </code></pre>
  
  <p>Here is the model:</p>
  
  <pre><code>&lt;?php
  
  namespace App;
  
  use Illuminate\Database\Eloquent\Model;
  
  class Companies extends Model {
      protected $table = 'companies'; 
  
      public function getUser(){
          return $this-&gt;hasMany('App\User', 'company_id');
      }
  }
  </code></pre>
  
  <p>and here is the controller:</p>
  
  <pre><code>$allCompanies   = Companies::withCount('getUser')-&gt;get();
  </code></pre>
  
  <p>When I call $theCompany->getUser, I get a json of users but withCount returns always NULL.</p>