feat: enhance environment variable handling to support mixed formats and add comprehensive tests

This commit is contained in:
Andras Bacsai
2025-11-18 12:48:40 +01:00
parent 201c9fada3
commit ab472bf5ed
3 changed files with 127 additions and 4 deletions
@@ -276,8 +276,9 @@ class All extends Component
}
// Extract value and comment from parsed data
$value = $data['value'] ?? $data;
$comment = $data['comment'] ?? null;
// Handle both array format ['value' => ..., 'comment' => ...] and plain string values
$value = is_array($data) ? ($data['value'] ?? '') : $data;
$comment = is_array($data) ? ($data['comment'] ?? null) : null;
$method = $isPreview ? 'environment_variables_preview' : 'environment_variables';
$found = $this->resource->$method()->where('key', $key)->first();