title: Laravel get data from all items from paginate
body: <p>I have a paginate:</p>
  
  <pre><code>$posts = $posts-&gt;paginate(5);
  </code></pre>
  
  <p>I have a relation:</p>
  
  <pre><code>public function category() {
     return $this-&gt;belongsTo(Category::class);
  }
  </code></pre>
  
  <p>I need get all count category of posts. But How, if on page I have only 5 posts? When I do on blade:</p>
  
  <pre><code>$posts-&gt;pluck('category')-&gt;count();
  </code></pre>
  
  <p>I get only count for 1 page posts. How I can get count for all pages? </p>