Skip to content

Commit

Permalink
Fix processing of fields with max_files: 1 (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
aerni authored May 24, 2024
1 parent a43f731 commit 2e8869e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Fields/Assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 2e8869e

Please sign in to comment.