title: Get ID from Laravel eloquent query through a relationship
body: <p>A <code>company</code> hasMany <code>users</code>, this relationship is achieved through a pivot table. I want to be able to get the <code>company.ID</code> of the company an individual user is related to:</p>
  
  <pre><code>$company_id = User::find(Auth()-&gt;$id)-&gt;companies-&gt;get('$id');
  </code></pre>
  
  <p>Unfortunately, I have also tried the <code>pluck()</code> method, but to no success. How can one retrieve a specific value from a formula like this?</p>