title: Laravel eloquent deep count with relationship
body: <p>I want to get count from deep table and the relationship is A->B->C->D and I want total count of D. <br><br>
  For example;<br> 
  A: 3 Boss<br>
  B: 5 Managers<br>
  C: 8 Human Resources<br>
  D: 25 Employees<br><br>
  Imagine that every boss has managers and every manager has human resources and also every human resource has employees. <br><br>How can I get total count every boss's employees' with Laravel. (For instance, first boss has 7 employees at the end.) Should I have to write hard sql code like joins or can I handle with eloquent?</p>
  
  <p>By the way, my tables:<br>
  A: id, name<br>
  B: id, name<br>
  A and B has pivot table.<br><br>
  C: id, name<br>
  B and C has pivot table<br><br>
  D: id, name<br>
  C and D has pivot table</p>
  
  <p>So far, I tried to:<br></p>
  
  <pre><code>$a = Boss::with("a.b.c.d")-&gt;where("id", 10)-&gt;first();
  dd($a-&gt;b-&gt;c-&gt;d-&gt;count());
  </code></pre>
  
  <p>It just gave me d's count but I want to all of a's.</p>