From 722ce65b5b49bad975d3fec34ecfbd12ada0d82d Mon Sep 17 00:00:00 2001 From: Duncan McClean Date: Fri, 16 Aug 2024 14:53:32 +0100 Subject: [PATCH] Form fields should continue to output a key/value array --- src/Fieldtypes/HasSelectOptions.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Fieldtypes/HasSelectOptions.php b/src/Fieldtypes/HasSelectOptions.php index 3d5164a891..fb134dd841 100644 --- a/src/Fieldtypes/HasSelectOptions.php +++ b/src/Fieldtypes/HasSelectOptions.php @@ -212,4 +212,13 @@ private function multiSelectGqlType() }, ]; } + + public function extraRenderableFieldData(): array + { + return [ + 'options' => collect($this->getOptions()) + ->mapWithKeys(fn ($option) => [$option['value'] => $option['label']]) + ->all(), + ]; + } }