order = $order; $this->order->load('customer', 'order_items', 'shipping_address', 'billing_address'); $this->customer = $order->customer; $this->transaction = $transaction; $this->oldStatus = $oldStatus; $this->newStatus = $newStatus; $this->reason = $reason; } public function toArray(): array { return [ 'order' => $this->order, 'customer' => $this->customer ?? null, 'transaction' => $this->transaction ?? null, 'old_status' => $this->oldStatus, 'new_status' => $this->newStatus, 'reason' => $this->reason, ]; } public function getActivityEventModel() { return $this->order; } public function beforeDispatch() { // Add any pre-dispatch logic here if needed } public function afterDispatch() { // to do: maybe add some logic here } }