Skip to content

Commit

Permalink
Small clarification database transaction exceptions (#7471)
Browse files Browse the repository at this point in the history
I was looking for the (re) throw behaviour of exceptions in a `DB::transaction()` call. Looked it up in the code and thought it'd be good to mention in the docs.
  • Loading branch information
rtuin committed Nov 29, 2021
1 parent 8349059 commit e8f8f31
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion database.md
Expand Up @@ -263,7 +263,7 @@ If you would like to specify a closure that is invoked for each SQL query execut
<a name="database-transactions"></a>
## Database Transactions

You may use the `transaction` method provided by the `DB` facade to run a set of operations within a database transaction. If an exception is thrown within the transaction closure, the transaction will automatically be rolled back. If the closure executes successfully, the transaction will automatically be committed. You don't need to worry about manually rolling back or committing while using the `transaction` method:
You may use the `transaction` method provided by the `DB` facade to run a set of operations within a database transaction. If an exception is thrown within the transaction closure, the transaction will automatically be rolled back and the exception is re-thrown. If the closure executes successfully, the transaction will automatically be committed. You don't need to worry about manually rolling back or committing while using the `transaction` method:

use Illuminate\Support\Facades\DB;

Expand Down

0 comments on commit e8f8f31

Please sign in to comment.