From adb6678eee5144b856683f08560a8294f23063f4 Mon Sep 17 00:00:00 2001 From: gOOvER Date: Sat, 14 Feb 2026 00:12:44 +0100 Subject: [PATCH] Convert YAML boolean defaults to strings (#2232) --- app/Services/Eggs/Sharing/EggImporterService.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/Services/Eggs/Sharing/EggImporterService.php b/app/Services/Eggs/Sharing/EggImporterService.php index 5c3f10939..c8fced139 100644 --- a/app/Services/Eggs/Sharing/EggImporterService.php +++ b/app/Services/Eggs/Sharing/EggImporterService.php @@ -189,6 +189,18 @@ class EggImporterService } } + // Convert YAML booleans to strings to prevent Laravel from converting them to 1/0 + // when saving to TEXT field. Required for validation rules like "in:true,false". + if (isset($parsed['variables'])) { + $parsed['variables'] = array_map(function ($variable) { + if (isset($variable['default_value']) && is_bool($variable['default_value'])) { + $variable['default_value'] = $variable['default_value'] ? 'true' : 'false'; + } + + return $variable; + }, $parsed['variables']); + } + // Reserved env var name handling [$forbidden, $allowed] = collect($parsed['variables']) ->map(fn ($variable) => array_merge(