belongsTo(Site::class); } public function typedValue(): mixed { return match ($this->type) { 'boolean' => filter_var($this->value, FILTER_VALIDATE_BOOLEAN), 'integer' => (int) $this->value, 'json' => json_decode((string) $this->value, true), default => $this->value, }; } }