Skip to content

Commit

Permalink
fix: remove forever caching on get method
Browse files Browse the repository at this point in the history
  • Loading branch information
chipslays committed Jul 16, 2023
1 parent 054b250 commit 3473fbe
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Option.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ public static function get(string $key, mixed $default = null, DateInterval|Date

$value = self::query()->find($key)?->value ?? $default;

Cache::put('larastash:options_' . $key, $value, $ttl);
if ($ttl !== null) {
Cache::put('larastash:options_' . $key, $value, $ttl);
}

return $value;
}
Expand Down

0 comments on commit 3473fbe

Please sign in to comment.