26 lines
785 B
PHP
26 lines
785 B
PHP
<?php
|
|
|
|
namespace Modules\Core\Order\Events;
|
|
|
|
use Illuminate\Foundation\Events\Dispatchable;
|
|
use Lunar\Models\Order;
|
|
|
|
/**
|
|
* Dispatched by OrderObserver::updated() whenever an Order's status column
|
|
* changes, regardless of what wrote it — Filament's UpdateStatusAction,
|
|
* artisan tinker, a future API. Lunar's own UpdatesOrderStatus trait fires
|
|
* mailers inline, but only for that one admin action; this event is the
|
|
* general-purpose hook everything else (our own mailers, automations,
|
|
* derived payment/fulfillment status) should listen to instead.
|
|
*/
|
|
class OrderStatusUpdated
|
|
{
|
|
use Dispatchable;
|
|
|
|
public function __construct(
|
|
public readonly Order $order,
|
|
public readonly ?string $previousStatus,
|
|
public readonly string $newStatus,
|
|
) {}
|
|
}
|