Cast::DATE, self::COL_NAME_EXPIRES_AT => Cast::DATETIME, self::COL_NAME_USED_AT => Cast::DATETIME, ]; public function getHistory(): ?HistoryModel { return null; } public function getModelName(): string { return "認証済みQRサービス券"; } /** * 期限切れ判定 切れている場合trueを返却 */ public function iseExpired(?Carbon $基準時刻 = null): bool { if ($this->expires_at === null) return false; if ($基準時刻 === null) { $基準時刻 = DateUtil::now(); } if ($this->expires_at < $基準時刻) { return true; } return false; } /** * 使用済み判定 使用済みの場合trueを返却 * * @return boolean */ public function isUsed(): bool { return $this->used_at !== null; } }