Set one or many attributes.

@param array ...$attributes

@return Bluora\LaravelHtmlBuilder\Tag
547158
public function setAttributes()
    {
        $attributes = func_get_args();
        if (count($attributes)) {
            if (count($attributes) == 1 && is_array($attributes[0])) {
                $attributes = $attributes[0];
            }
            $this->attributes = $attributes;
        }

        return $this;
    }
745093
public function setIconAttributes($attributes)
    {
        if (! is_array($attributes)) {
            $attributes = [$attributes];
        }

        $this->icon_attributes = $attributes;

        return $this;
    }
1091282
protected function buildAttributes(array $attributes)
    {
        $html = [];

        foreach ($attributes as $key => $value) {
            $html[] = $key.'="'.$value.'"';
        }

        return count($html) ? ' '.implode(' ', $html) : '';
    }
1325635
public function remove($attributes)
    {
        foreach ((array) $attributes as $attribute) {
            unset($this->defaults[$attribute],
                $this->types[$attribute],
                $this->requires[$attribute],
                $this->notNullables[$attribute]);
        }

        return $this;
    }
945637
public function open( $attributes = array() ) {
        $this->setAttributes( $attributes );
        $html = '<' . $this->tagName
                    . $this->renderAttributes()
                    ;
        // should we close it ?
        if( $this->closeEmpty || $this->hasChildren() ) {
            $html .= '>';
        } else {
            $html .= '/>';
        }
        return $html;
    }
290378
public function createElement(array $attributes)
    {
        $meta = $this->ownerDocument->createElement('meta');

        $name = null;
        foreach ($attributes as $key => $value) {
            $meta->setAttribute($key, $value);
        }

        $this[] = $meta;

        return $meta;
    }
927738
public function fill(array $attributes = [])
    {
        foreach ($attributes as $key => $value) {
            $this->setAttribute($key, $value);
        }

        return $this;
    }
363529
public function append($attributes)
    {
        $this->appends = array_unique(
            array_merge($this->appends, is_string($attributes) ? func_get_args() : $attributes)
        );

        return $this;
    }
779555
public function setAttributes(array $attributes = null)
    {
        ValidationUtility::ensureNullOrArrayOfType(
            '$attributes', $attributes, __NAMESPACE__ . '\Pair');

        $this->attributes = $attributes;

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

		return $this;
	}
786770
public function tableAttributes(array $attributes = array()): Builder
    {
        array_set($attributes, 'id', array_get($attributes, 'id') . str_random(3));
        $this->tableAttributes = array_merge($this->tableAttributes, $attributes);
        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;
    }
720627
public function setAttrArray(array $attributes)
    {
        foreach ($attributes as $attribute => $value) {
            $this->setAttr($attribute, $value);
        }
    }
812301
private function putAttributes($attributes)
	{
		$output = '';

		foreach($attributes as $attribute => $value)
		{
			$output.= ' '.$attribute. '="'.$value.'"';
		}

		return $output;
	}
1096913
public function createElement(array $attributes)
    {
        $element = $this->ownerDocument->createElement($this->element);

        $name = null;
        foreach ($attributes as $key => $value) {
            $element->setAttribute($key, $value);
        }

        $this[] = $element;

        return $element;
    }
1259588
public function addAttributes(array $attributes)
    {
        foreach ($attributes as $attribute => $value) {
            $this->addAttribute($attribute, $value);
        }

        return $this;
    }
878133
public function setAttributes(array $attributes)
    {
        $flattened = array_dot($attributes);

        $fields = $this->getFields();
        if (empty($fields))
            $fields = array_keys($attributes);

        foreach ($fields as $field) : 

            // make sure we have an aliased fields list
            $fillableKeys   = array_keys($this->fillable);
            $aliasedFields  = !empty($fillableKeys) && !is_integer($fillableKeys[0]);

            // read full path to attribute (get dot notation if available).
            $attribFullPath = isset($this->fillable[$field]) ? $this->fillable[$field] : $field;

            $hasByPath  = array_has($flattened, $attribFullPath);
            $hasByAlias = array_has($attributes, $field);

            if (! $hasByPath && ! $hasByAlias) {
                // try deep find and continue

                // browse attributes array in depth.
                $attrib = $attributes;
                foreach (explode(".", $attribFullPath) as $key) {
                    if (! isset($attrib[$key]))
                        $attrib[$key] = null;

                    $attrib = $attrib[$key];
                }

                $this->setAttribute($field, $attrib);
                continue;
            }

            // use attribute path or alias
            $attribValue = $hasByPath ? array_get($flattened, $attribFullPath)
                                      : array_get($attributes, $field);

            $this->setAttribute($field, $attribValue);
        endforeach ;

        return $this;
    }