Skip to content

Commit

Permalink
Fix expired and not expired attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasdotvin committed Apr 23, 2022
1 parent 48a1316 commit 257e671
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/Models/Concerns/ExpiresAndHasGraceDays.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,21 @@ public function initializeExpiresAndHasGraceDays()

public function expired()
{
return ! is_null($this->expired_at);
if (is_null($this->grace_days_ended_at)) {
return $this->expired_at->isPast();
}

return $this->expired_at->isPast()
and $this->grace_days_ended_at->isPast();
}

public function notExpired()
{
return is_null($this->expired_at);
if (is_null($this->grace_days_ended_at)) {
return $this->expired_at->isFuture();
}

return $this->expired_at->isFuture()
or $this->grace_days_ended_at->isFuture();
}
}

0 comments on commit 257e671

Please sign in to comment.