Skip to content

Commit

Permalink
Feat: Allow the configuration multiple property to be set to tru by s…
Browse files Browse the repository at this point in the history
…etting count>0 on config type 'array'.
  • Loading branch information
3m1n3nc3 committed Oct 10, 2024
1 parent 56261ea commit e5f2d69
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/Models/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public function scopeNotSecret(Builder $query, $secret = false): void
public function multiple(): Attribute
{
return new Attribute(
get: fn() => count($this->choices) && $this->autogrow,
get: fn() => (count($this->choices) && $this->autogrow) || ($this->type === 'array' && $this->count),
set: fn($value) => [
'autogrow' => $value
],
Expand Down Expand Up @@ -214,4 +214,4 @@ public function doUpload(UploadedFile|array $files)

return json_encode($value);
}
}
}

0 comments on commit e5f2d69

Please sign in to comment.