first(); return $setting ? $setting->value : $default; } public static function set(string $key, mixed $value): void { static::updateOrCreate(['key' => $key], ['value' => $value]); } public static function getBool(string $key, bool $default = false): bool { $value = static::get($key, $default); return filter_var($value, FILTER_VALIDATE_BOOLEAN); } public static function setBool(string $key, bool $value): void { static::set($key, $value ? '1' : '0'); } public static function isArticleProcessingEnabled(): bool { return static::getBool('article_processing_enabled', true); } public static function setArticleProcessingEnabled(bool $enabled): void { static::setBool('article_processing_enabled', $enabled); } public static function isPublishingApprovalsEnabled(): bool { return static::getBool('enable_publishing_approvals', false); } public static function setPublishingApprovalsEnabled(bool $enabled): void { static::setBool('enable_publishing_approvals', $enabled); } }