diff options
Diffstat (limited to 'src/Models')
-rw-r--r-- | src/Models/AccessLog.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Models/AccessLog.php b/src/Models/AccessLog.php index 0c177a3..2cb510c 100644 --- a/src/Models/AccessLog.php +++ b/src/Models/AccessLog.php @@ -39,6 +39,9 @@ class AccessLog extends Model public function prunable(): Builder { $days = config('access_log.max_age_days'); - return static::where(static::CREATED_AT, '<=', now()->subDays($days)); + if ($days === null) { + return static::whereRaw('1 = 0'); + } + else return static::where(static::CREATED_AT, '<=', now()->subDays($days)); } } |