From 546ded24b4787d7c361851167bb82a8eb266c941 Mon Sep 17 00:00:00 2001 From: Matthias van Pijkeren Date: Mon, 6 May 2024 22:22:24 +0200 Subject: [PATCH] #18 added function for max_sets --- src/FieldTypes/Replicator.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/FieldTypes/Replicator.php b/src/FieldTypes/Replicator.php index 8177230..9422aff 100644 --- a/src/FieldTypes/Replicator.php +++ b/src/FieldTypes/Replicator.php @@ -47,7 +47,7 @@ public function setGroupsToArray(): array $this->setGroups = collect($this->setGroups); $this->setGroups = $this->setGroups->filter(function ($setGroup) { - if (! $setGroup instanceof SetGroup) { + if (!$setGroup instanceof SetGroup) { throw new BlueprintRenderException('Replicator field only accepts SetGroups\s as children.'); } @@ -68,6 +68,13 @@ public function previews($previews = true) return $this; } + public function maxSets(int $max_sets) + { + $this->max_sets = $max_sets; + + return $this; + } + public function collapse(CollapseOption $collapse) { $this->collapse = $collapse;