title: How to bulk-select only pivot tables using Eloquent?
body: <p>I have two models with <em>many-to-many</em> relationship defined between them: <code>User</code> and <code>Post</code>. I need to access <strong>all of the user's posts' pivot table records</strong>. How can I achieve this? For example:</p>
  
  <pre class="lang-php prettyprint-override"><code>$user-&gt;posts()-&gt;pivot()-&gt;get(); // I need to do something like this
  </code></pre>
  
  <p>The reason why I need this, is to perform a bulk-update in one query on those pivots. Illustration example:</p>
  
  <pre class="lang-php prettyprint-override"><code>// set 'times_seen' to 100 for all of the pivot records
  $user-&gt;posts()-&gt;pivot()-&gt;update(['times_seen' =&gt; 100]); 
  </code></pre>