title: Laravel count where row value > 0
body: <p>I've been trying to find a solution for my query for some time now. But i haven't been able to solve it yet. Most of it works nicely, but the count part does not work like i intend it to.</p>
  
  <p>My query looks like this:</p>
  
  <pre><code>        $years = Sample::whereCostumerId($id)
          -&gt;groupBy('year')
          -&gt;orderBy('year', 'DESC')
          -&gt;get(array(
              DB::raw('year'),
              DB::raw('COUNT(id) as antalProver'),
              DB::raw('MIN(provnr) AS minProvnr'),
              DB::raw('MAX(provnr) AS maxProvnr'),
              DB::raw('count(P_HCl) AS numP_HCl'),
              DB::raw('count(Total_lerhalt) AS numLerhalt'),
              DB::raw('ROUND(AVG(pH),1) AS avgpH'),
              DB::raw('ROUND(AVG(P_AL),1) AS avgP_AL'),
              DB::raw('ROUND(AVG(K_AL),1) AS avgK_AL'),
              DB::raw('AVG(X) AS coordExist')
          ));
  </code></pre>
  
  <p>The issue here is that many of the rows in the column P_HCl and Total_lerhalt contains zero. And i don't want to count these. I only want to count where value is greater than zero.
  Im shure there's some nice solution for this.
  If you guys have any other solution for the query all together id be happy to see it.</p>
  
  <p>Thanks</p>