diff --git a/src/ListView.php b/src/ListView.php index 2922c9ff8..2545768be 100644 --- a/src/ListView.php +++ b/src/ListView.php @@ -138,8 +138,12 @@ public function itemView(string|Closure $value): self public function itemViewTag(?string $tag): self { + if ($tag === '') { + throw new InvalidArgumentException('Tag name cannot be empty.'); + } + $new = clone $this; - $new->itemViewTag= $tag; + $new->itemViewTag = $tag; return $new; }