title: Laravel Sum column database Eloquent
body: <p>Trying to get the sum of a int field in one of my table should be pretty easy, unfortunately it is not as I'm getting different result whether I use Laravel, MySQL or Excel.</p>
  
  <p>Laravel 5.4 gives me <strong>20506</strong>:</p>
  
  <pre><code>Table::sum('field_name');
  </code></pre>
  
  <p>MySQL gives me <strong>1830</strong>:</p>
  
  <pre><code>Select sum(field_name) from table;
  </code></pre>
  
  <p>And the data from the Excel sheet before importing it into the database:
  Sum gives me <strong>145689</strong></p>
  
  <p>Any idea? I tried to cast to integer before doing the sum but it doesn't work.
  All the numbers are pretty big but don't contain comma or dot.</p>
  
  <p>Examples of values I have to sum: (contain sometimes empty cells)</p>
  
  <pre><code>17906774
  99630157
  28581131
  
  159551532
  20312892
  668928885
  </code></pre>