statusTransitionCause = ... broke immediately with an * "undefined column" error the moment ->update() ran. */ class OrderStatusWriter { public function write(Order $order, string $to, string $causeClass): void { $from = $order->status; if ($from === $to) { return; } $order->update(['status' => $to]); OrderStatusChanged::dispatch($order, $from, $to, $causeClass); } public function markPaid(Order $order, string $causeClass): void { if ($order->paid) { return; } $order->update(['paid' => true, 'paid_at' => now()]); OrderPaidChanged::dispatch($order, $causeClass); } }