Skip to content
Discussion options

You must be logged in to vote

I'm new to Laravel, but not new to software engineering. The point of this hook and the transaction factor seems to be the ability to react when a record is actually been changed/created. If no transaction is in progress, this means that we are in "auto-commit" mode, which wraps every query with a transaction that is automatically committed.

So, by specifying $afterCommit = true, you are probably saying in Laravel language: "I want this to run only when the change is actually persisted for all users", which happens automatically on every non-transactional query.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@discoverlance-com
Comment options

Answer selected by discoverlance-com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants