diff --git a/src/Twig/Component/Badge.php b/src/Twig/Component/Badge.php index 0f334c0..e6df824 100644 --- a/src/Twig/Component/Badge.php +++ b/src/Twig/Component/Badge.php @@ -13,6 +13,7 @@ use TailwindMerge\TailwindMerge; final class Badge { public string $finalClasses; + public ?string $label = null; public function __construct(private string $baseClasses) { @@ -28,6 +29,8 @@ final class Badge */ public function mount(?BadgeableInterface $obj = null, ?string $class = null, ?string $colour = null, ?string $label = null, bool $outline = false): void { + $this->label = $label; + if (!$obj && !$colour) { throw new \RuntimeException(sprintf('You must specify either a colour an instance of "%s".', BadgeableInterface::class)); }