Skip to content

Commit dcb2c6e

Browse files
committed
feat: Handle grace days in renewals with preset expiration for plans with no periodicity
1 parent 7df46b4 commit dcb2c6e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Models/Subscription.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public function renew(?Carbon $expirationDate = null): self
112112
$expirationDate = $this->getRenewedExpiration($expirationDate);
113113
$graceDaysEndedAt = null;
114114

115-
if ($this->plan->grace_days) {
115+
if ($this->plan->grace_days && $expirationDate) {
116116
$graceDaysEndedAt = $expirationDate->copy()->addDays($this->plan->grace_days);
117117
}
118118

0 commit comments

Comments
 (0)