site updates

This commit is contained in:
Mark Gregory
2026-10-06 08:47:30 +01:00
parent f9c697619a
commit 211115c9bc
154 changed files with 2560 additions and 280 deletions
@@ -18,6 +18,12 @@ final class SiteSetting extends Model
return Cache::remember('sonardesk.setting.'.$key, 300, fn () => static::query()->find($key)?->value ?? $default);
}
public static function booleanFor(string $key, bool $default = false): bool
{
$value = static::valueFor($key);
return $value === null ? $default : filter_var($value, FILTER_VALIDATE_BOOLEAN);
}
public static function put(string $key, ?string $value): void
{
static::query()->updateOrCreate(['key' => $key], ['value' => $value]);