title: Laravel 5.4: Directly Subtract number from column in database
body: <p>I want to subtract 100 number from credit column in database that is having int data type. I am looking for the way to directly subtract it with some Laravel query. But right now I first get the column value from the table and then subtract and then need to write update query to update it like below:</p>
  
  <pre><code>$subtractCredit = 100;
  
  // Get Total Credit
  $totalCredit = User::select('credit')-&gt;where(['username'=&gt;$username])-
  &gt;first(); 
  
  // Subtract 100 from Total Credit
  $totalCredit = $totalCredit-&gt;credit - $subtractCredit;
  
  // Update Credit in Table
  User::where(['username'=&gt;$username])-&gt;update(['credit' =&gt; $totalCredit]);
  </code></pre>
  
  <p>In the above code, I first get total credit from query and then subtract 100 from total credit and then update credit again with update query. </p>
  
  <p>Please let me know the better approach of doing it.</p>