title: How to merge count and sum queries in one query in Eloquent
body: <p>I have  problem with queries in my Controller. I want to count rows and sum by column in one query. </p>
  
  <p><b>Relations view</b></p>
  
  <p><img src="https://i.imgur.com/2EyMHYK.jpg" alt="a busy cat"></p>
  
  <p>So far, I created two queries:</p>
  
  <p><b>Query to count rows</b></p>
  
  <pre><code>$paymentsCount = Payments::where('pay_status', 'like', "%{$payStatus}%")-&gt;count();
  
  </code></pre>
  
  <p><b>Query to sum</b></p>
  
  <pre><code>$paymentsValue = Payments::where('pay_status', 'like', "%{$payStatus}%")-&gt;sum('brutto');
  </code></pre>
  
  <p>I have no Idea, how to make on query instead this two queries.</p>
  
  <p>I will be grateful for any help.</p>