From 2e8869eac1546a4266aadcf3f6bf11a9fd08e60d Mon Sep 17 00:00:00 2001 From: Michael Aerni Date: Fri, 24 May 2024 10:32:53 -0400 Subject: [PATCH] Fix processing of fields with `max_files: 1` (#60) --- src/Fields/Assets.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Fields/Assets.php b/src/Fields/Assets.php index a6de0446..96df54b9 100644 --- a/src/Fields/Assets.php +++ b/src/Fields/Assets.php @@ -67,7 +67,8 @@ protected function dimensionsProperty(): array public function process(): mixed { $this->value = collect($this->value) - ->flatMap(fn ($file) => AssetsUploader::field($this->field)->upload($file)); + ->map(fn ($file) => AssetsUploader::field($this->field)->upload($file)) + ->flatten(); return parent::process(); }