SyntaxFix
Write A Post
Hire A Developer
Questions
You can do this:
DB::transaction(function() { // });
Everything inside the Closure executes within a transaction. If an exception occurs it will rollback automatically.