Skip to content

Conversation

maltekuhr
Copy link
Contributor

Summary

  • add DB::afterRollback to mirror afterCommit
  • queue rollback callbacks through the transactions manager
  • cover the new API with integration tests

Rationale

  • lets applications react immediately after a rollback, e.g. releasing cache locks when a transaction fails
  • complements existing afterCommit hooks so both success and failure paths can be handled
  • touches only the transaction callback plumbing and facade docblocks, so no behaviour changes for existing code

Testing

  • vendor/bin/phpunit tests/Integration/Database/DatabaseTransactionsTest.php

@taylorotwell taylorotwell merged commit 9190754 into laravel:12.x Sep 26, 2025
63 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants