name($name); } public static function make(string $name): static { $static = app(static::class, ['name' => $name]); $static->configure(); return $static; } public function icon(string | Closure | null $icon): static { $this->icon = $icon; return $this; } public function getIcon(): ?string { return $this->evaluate($this->icon); } public function maxItems(int | Closure | null $maxItems): static { $this->maxItems = $maxItems; return $this; } public function getMaxItems(): ?int { return $this->evaluate($this->maxItems); } /** * @param array | null $state */ public function getLabel(?array $state = null, ?string $uuid = null): string | Htmlable { return $this->evaluate( $this->label, ['state' => $state, 'uuid' => $uuid], ) ?? $this->getDefaultLabel(); } }