Hey, I'm writing a book.  Eloquent Beyond The Basics

🔥 Laravel Tip: You can write transaction-aware code

Oct 22, 2022

Using `DB::afterCommit` method you can write code that will only be executed if the transaction gets committed and discarded if the transaction is rolled back.

if there is no transaction, the code will be executed right away