src/Metable/AttributeBag.php
public function set($key, $value = null, $group = null)
    {
        if ($key instanceof Attribute) {
            return $this->setInstance($key);
        }

        if ($this->has($key)) {
            $this->update($key, $value, $group);
        } else {
            $this->items[$key] = $this->newAttribute($key, $value, $group);
        }

        return $this;
    }
public function set($key, $value = null, $group = null)
    {
        if ($key instanceof Attribute) {
            return $this->setInstance($key);
        }

        if ($this->has($key)) {
            $this->update($key, $value, $group);
        } else {
            $this->items[$key] = $this->newAttribute($key, $value, $group);
        }

        return $this;
    }
Add or update attribute.

@param  \Sofa\Eloquence\Metable\Attribute|string $key
@param  mixed $value
@return $this