diff --git a/src/Models/Order.php b/src/Models/Order.php index 24f5fb78..173fe916 100644 --- a/src/Models/Order.php +++ b/src/Models/Order.php @@ -212,6 +212,26 @@ protected function statusName(): Attribute ); } + /** + * Get the payment status name attribute. + * + * @return \Illuminate\Database\Eloquent\Casts\Attribute + */ + protected function paymentStatus(): Attribute + { + return new Attribute( + get: function (): string { + return match (true) { + $this->refunded() => __('Refunded'), + $this->partiallyRefunded() => __('Partially Refunded'), + $this->paid() => __('Paid'), + $this->partiallyPaid() => __('Partially Paid'), + default => __('Pending Payment'), + }; + } + ); + } + /** * Get the columns that should receive a unique identifier. */