title: Laravel Eloquent ORM Transactions: Why we need ROLLBACK?
body: <p>Why we need <code>DB::rollback()</code> when we can execute multiple queries without using it. Such as follows:</p>
  
  <pre><code>DB::beginTransaction();
   //database queries here
  
   //even if any errors pop up here, it won't reach DB::commit() and code won't get committed
  DB::commit();
  </code></pre>
  
  <p>In the above case, <strong>even if any statement fails, commit will never hit</strong>, and the transaction won't process. So rollback isn't needed or mandatory?</p>