Transaction-aware Event Dispatcher for Laravel
transactional
namespaced helper.transactional
namespaced helper.transactional
helper. See #39Alternatively, use TransactionalClosureEvent
directly.
Event::dispatch(new TransactionalClosureEvent(function () {
// Job will be dispatched only if the transaction commits.
ProcessOrderShippingJob::dispatch($order);
});
TransactionalDispatcher
class