title: Laravel Eloquent and SUM() - Do not consider the decimal
body: <p>I run in a strange issue, I need to sum a column using eloquent but every function I use eloquent do not consider the decimal.</p>
  
  <p>First of all I have the column set ad <code>DECIMAL(8,2)</code> and in my DB the data is stored in the correct way.</p>
  
  <p><a href="https://i.stack.imgur.com/DsA96.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DsA96.png" alt="enter image description here"></a></p>
  
  <p>If I just use a simple query:</p>
  
  <pre><code>select sum(total_after_tax) from invoice_details where invoice_id = 1
  </code></pre>
  
  <p>I get the result: <code>312.93</code></p>
  
  <p>Now if I use eloquent:</p>
  
  <pre><code>$invoice = Invoice::with(['details'])-&gt;get();
  dd($invoice-&gt;first()-&gt;details-&gt;sum('total_after_tax'));
  </code></pre>
  
  <p>I get: <code>312</code>.</p>
  
  <p>How is this possibile? How can I get the correct value form DB?</p>