Skip to content

Commit

Permalink
Fix assets upload (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
aerni authored Nov 20, 2024
1 parent dba32af commit 4a80c31
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Fields/Assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ class Assets extends Field
{
protected string $view = 'assets';

protected function defaultProperty(mixed $default = null): array
{
/* We need to initialize the value to an empty array for the upload to work. */
return [];
}

protected function multipleProperty(?bool $multiple = null): bool
{
return $multiple ?? $this->field->get('max_files') !== 1;
Expand Down

0 comments on commit 4a80c31

Please sign in to comment.