Hook: order_status_updated
Last updated on May 21, 2026 05:09
Overview
Type: Action
Location: app/Http/Controllers/Api/V1/OrderController.php
Fired whenever an order status changes. This is the primary hook for order lifecycle integrations such as notifications, ERP sync, or analytics tracking.
Parameters
| Param | Type | Description |
|---|---|---|
$order |
Order | Order model instance |
$oldStatus |
string | Previous status |
$newStatus |
string | New status |
Usage Example
Hook::addAction('order_status_updated', function ($order, $old, $new) {
if ($old === 'pending' && $new === 'processing') {
Notification::send($order->user, new OrderConfirmed($order));
}
});
Related Hooks
- order_completed - Fired when status becomes completed