Laravel - Getting Started - Manually Using Transactions

If you would like to begin a transaction manually and have complete control over rollbacks and commits, you may use the beginTransaction method provided by the DB facade:

    
    use Illuminate\Support\Facades\DB;
    
    DB::beginTransaction();
	

You can rollback the transaction via the rollBack method:

    
    DB::rollBack();
	

Lastly, you can commit a transaction via the commit method:

    
    DB::commit();
	
The DB facade's transaction methods control the transactions for both the query builder and Eloquent ORM.