@param Closure|string $value
@param array $attributes

@return $this
186914
public function addBadge($value, array $attributes = null)
    {
        $this->setBadge(
            $badge = app(BadgeInterface::class)
        );

        $badge->setValue($value);

        if (is_array($attributes)) {
            $badge->setHtmlAttributes($attributes);
        }

        return $this;
    }
948051
public static function group(array $attributes, Closure $closure)
    {
        $hash = uniqid('prop_');
        //Add options
        if (isset($attributes['prefix'])) {
            static::$groupsProps['prefix'][$hash] = $attributes['prefix'];
        }
        if (isset($attributes['namespace'])) {
            static::$groupsProps['namespace'][$hash] = $attributes['namespace'];
        }
        if (isset($attributes['name'])) {
            static::$groupsProps['name'][$hash] = $attributes['name'];
        }
        if (isset($attributes['middlewares']) || isset($attributes['middleware'])) {
            static::$groupsProps['middleware'][$hash] = isset($attributes['middleware']) ?
                (array)$attributes['middleware'] :
                (array)$attributes['middlewares'];
        }
        //Run closure
        $closure();
        //Remove options
        unset(static::$groupsProps['prefix'][$hash]);
        unset(static::$groupsProps['namespace'][$hash]);
        unset(static::$groupsProps['name'][$hash]);
        unset(static::$groupsProps['middleware'][$hash]);
    }
599236
public function with($key, $value = null)
    {
        if (is_array($key)) {
            $this->attributes = array_merge($this->attributes, $key);
        } else {
            $this->attributes[$key] = $value;
        }

        return $this;
    }
637020
public function setAttr(string $name, string $value)
    {
        $this->attr[$name] = $value;

        return $this;
    }
542741
public function setAttributes($attributes) {
		if (is_array($attributes) && empty($attributes)) {
			$this->attributes = new \stdClass;
		} else {
			$this->attributes = $attributes;
		}

		return $this;
	}
740554
public static function checkbox($name, $value, $attributes = array())
    {
        $attributes['value'] = $value;
        return self::input('checkbox', $name, $attributes);
    }
1102387
public function fill(array $attributes): self
    {
        foreach ($attributes as $name => $value) {
            if (1 === preg_match('/_/', $name)) {
                $name = StringHelper::camel($name);
            }
            $methodName = sprintf('set%s', ucfirst($name));
            if (method_exists($this, $methodName)) {
                $this->$methodName($value);
            }
        }

        return $this;
    }
521383
public function setAttributes($attributes)
    {
        foreach ($attributes as $key => $string_values) {
            $values = explode(' ', $string_values);

            // Trim the values
            $values = array_map('trim', $values);
            // Remove empty elements
            $values = array_filter($values);
            // Remove duplicate values
            $values = array_unique($values);

            $this->attributes[$key] = $values;
        }

        return $this;
    }
775546
public function setItemAttribute(string $attribute, string $value = '')
    {
        $this->applyToAll(function (HasHtmlAttributes $link) use ($attribute, $value) {
            $link->setAttribute($attribute, $value);
        });

        return $this;
    }
1086312
public function setAttribute(string $attribute, string $value = '')
    {
        if ($attribute === 'class') {
            $this->addClass($value);

            return $this;
        }

        $this->attributes[$attribute] = $value;

        return $this;
    }
449297
public function setAttributes(array $attributes = [])
    {
        $this->attributes = array_merge($this->attributes, $attributes);
        isset($attributes['id']) ? $this->id         = $attributes['id'] : null;
        return $this;
    }
1352513
public function setAttributes(array $attributes)
    {
        $this->attributes = [];
        foreach ($attributes as $attribute => $value) {
            $this->addAttribute($attribute, $value);
        }

        return $this;
    }
877664
public function set_attr( $attribute, $value = null ) {
		if ( is_null( $value ) || $value === false ) {
			if ( array_key_exists( $attribute, $this->attr ) ) {
				unset( $this->attr[$attribute] );
			}
		} else {
			if ( $value === true ) {
				$value = $attribute;
			}
			$this->attr[ $attribute ] = $value;
		}
		
		return $this;
	}
299766
public function attr($name, $value = null)
    {
        if (func_num_args() < 2) {
            return @$this->attributes[$name];
        } else {
            if (is_null($value)) {
                unset($this->attributes[$name]);
            } else {
                $this->attributes[$name] = $value;
            }
            return $this;
        }
    }
1292589
public function removeAttributeValue(string $attribute, string $value): self
    {
        // Only remove value if attribute is present
        if (! array_key_exists($attribute, $this->attributes)) {
            return $this;
        }

        // Remove the value from the attribute
        $values = array_filter(
            $this->getAttribute($attribute),
            function ($attributeValue) use ($value) {
                return $attributeValue !== $value;
            }
        );

        // Stores the new values
        $this->setAttribute($attribute, $values);

        return $this;
    }
1324899
public function setAttr($attribute, $value = null)
    {
        if (is_array($attribute) && is_null($value)) {
            foreach ($attribute as $k => $v) {
                $this->setAttr($k, $v);
            }

            return $this;
        }
        $this->template->appendHTML('attributes', ' '.$attribute.'="'.$value.'"');

        return $this;
    }
1139721
public static function label( array $attributes = array(), $value = null, $close = true )
    {
        return static::tag( 'label', $attributes, $value, $close );
    }