title: Laravel "with" is not populate related model
body: <p>I have two tables in Laravel Eloquent:</p>
  
  <pre><code>UserCategory:
  id | user | category
  </code></pre>
  
  <p>and</p>
  
  <pre><code>Category:
  id | name 
  </code></pre>
  
  <p>UserCategories relates to Category trough <strong>belongsTo</strong>:</p>
  
  <pre><code>class UserCategory extends Model
  {
     public function category()
     {
         return $this-&gt;belongsTo('App\Category', 'category');
     }
  }
  </code></pre>
  
  <p>But when I try to get UserCategories with Categories I got integer value (instead of Category model)</p>
  
  <pre><code>$categories = [];
  $userCategory = UserCategory::where('user', $user-&gt;id)-&gt;with('category')-&gt;get();
  
  foreach($userCategory as $item) {
     $categories[] = $item-&gt;category-&gt;name;
  }   
  </code></pre>
  
  <p>When I try to get the category's name I see the second error:</p>
  
  <blockquote>
    <p>Trying to get property 'name' of non-object</p>
  </blockquote>
  
  <p>Curious thing, that when I use <code>dd($item)</code> I see that <em>$item</em> has correct relation to Category object, but  <code>dd($item-&gt;category)</code> returns integer value (category id) instead of category model.</p>