diff --git a/database/migrations/2024_04_16_233540_add_allowcustom_field.php b/database/migrations/2024_04_16_233540_add_allowcustom_field.php index 8482422f..3dd007e7 100644 --- a/database/migrations/2024_04_16_233540_add_allowcustom_field.php +++ b/database/migrations/2024_04_16_233540_add_allowcustom_field.php @@ -1,10 +1,8 @@ get() as $event) { $config = json_decode($event->config); $config->sections = array_map(function ($section) { - $section->fields = collect($section->fields)->map(function ($field) { + /** @var Collection */ + $fields = $section->fields; + $section->fields = collect($fields)->map(function ($field) { if ($field->type === 'DropdownField' || $field->type === 'RadioField') { $field->allowcustom = false; } @@ -33,7 +33,9 @@ return new class extends Migration foreach (DB::table('formtemplates')->get() as $event) { $config = json_decode($event->config); $config->sections = array_map(function ($section) { - $section->fields = collect($section->fields)->map(function ($field) { + /** @var Collection */ + $fields = $section->fields; + $section->fields = collect($fields)->map(function ($field) { if ($field->type === 'DropdownField' || $field->type === 'RadioField') { $field->allowcustom = false; }