validateScope($scope); $value = SiteSetting::valueFor($key); return $value ?? $default; } /** * Persist a SonarDesk site setting. * * The type and public arguments are retained for compatibility * with Stylist's existing theme management API. */ public function put( string $key, mixed $value, string $scope = 'site', string $type = 'string', bool $public = true ): void { $this->validateScope($scope); SiteSetting::put( $key, $value === null ? null : (string) $value ); } /** * Return all site settings as an associative array. */ public function site(): array { return SiteSetting::query() ->pluck('value', 'key') ->all(); } private function validateScope(string $scope): void { if ($scope !== 'site') { throw new \InvalidArgumentException( "Unsupported settings scope: {$scope}" ); } } }