title: How to calculate the percentage in eloquent?
body: <p>please have a look at the problem. You will find it interesting. 
  I have a table <code>member</code> in which I have a column <code>result</code>. In this result column three values can be possible and at one time only one value can be used. The value that are possible <code>W</code>, <code>L</code> and <code>V</code>. Forget about the <code>V</code> as it is not required here. </p>
  
  <p>Let's say, I have 5 rows and in 3 rows I have <code>W</code> and in 1 row I have <code>L</code> and last one is <code>V</code>. </p>
  
  <p>So here 3W and 1L out of 4(W+L together). So the percentage of W is 75%. How can I calculate it using mysql and if it is possible using eloquent would be better. </p>
  
  <p>Currently, I am using this solution 
  1. Getting all the rows 
  2. Running php loop 
  3. And based on the value of the result column I am calculating the percentage. works fine. But I think if there are better solution why not to find it :) </p>
  
  <p>Hope you have something for this problem. 
  Thanks in advance.  </p>