Your SaaS order just committed. The invoice row is in Postgres. Somewhere else a queue publish failed, timed out, or never ran because the process died between the two calls. Now billing thinks the order exists and the warehouse worker never heard about it. That gap is the dual-write problem, and it shows up in every Laravel app that "saves then dispatches."
I run Loop Origin , where we build and harden multi-tenant Laravel systems for product teams. I wrote this with help from AI tools and checked every command and claim myself. This is the pattern I reach for when a write must produce a side effect that another service, queue, or webhook consumer depends on.
How does the transactional outbox pattern fix dual writes?
Direct answer: Write the business row and an outbox row in the same database transaction. A separate worker reads unpublished outbox rows, publishes to the broker, then marks them published. Consumers must be idempotent because delivery is at-least-once, not exactly-once.…