Set a given JSON attribute on the model.

@param  string  $key
@param  mixed  $value
@return $this
970176
public function fillJsonAttribute($key, $value)
    {
        [$key, $path] = explode('->', $key, 2);

        $this->attributes[$key] = $this->asJson($this->getArrayAttributeWithValue(
            $path, $key, $value
        ));

        return $this;
    }
1151340
public function set($key, $value)
    {
        $allowed = array_diff(array_keys(get_class_vars(get_class($this))), $this->_hidden);
        if (empty($allowed) || !empty($allowed) && in_array($key, $allowed)) {
            if (method_exists($this, 'set' . ucfirst($key))) {
                call_user_func_array([$this, 'set' . ucfirst($key)], [$value]);
            } else {
                $this->{$key} = self::modelize($key, $value);
            }
        }

        return $this;
    }
617764
public function set_attribute( $key, $value ) {
		$this->attributes[ $key ] = $this->sanitize_attribute( $key, $value );

		return $this;
	}
1270549
public function setAttribute(string $key, $value): AbstractNode
    {
        $this->tag->setAttribute($key, $value);

        //clear any cache
        $this->clear();

        return $this;
    }
112822
public function setAttribute($key, $value)
	{
		// First we will check for the presence of a mutator for the set operation
		// which simply lets the developers tweak the attribute as it is set on
		// the model, such as "json_encoding" an listing of data for storage.
		if ($this->hasSetMutator($key))
		{
			$method = 'set'.studly_case($key).'Attribute';

			return $this->{$method}($value);
		}

		// If an attribute is listed as a "date", we'll convert it from a DateTime
		// instance into a form proper for storage on the database tables using
		// the connection grammar's date format. We will auto set the values.
		elseif (in_array($key, $this->getDates()))
		{
			if ($value)
			{
				$value = $this->fromDateTime($value);
			}
		}

		$this->attributes[$key] = $value;
	}
1368217
public function setAttribute($key, $value = null)
    {
        if (is_array($key) && is_null($value)) {
            $this->attributes = $key;
        } else {
            array_set($this->attributes, $key, $value);
        }

        return $this;
    }
1109932
public function setAttribute($key, $value)
    {
        if ($value !== null && $this->isSerializeCastable($key)) {
            $value = $this->asSerialize($value);
        }

        return parent::setAttribute($key, $value);
    }
696020
public function setJson($key, $value = null): void
    {
        if (is_array($key)) {
            foreach ($key as $k => $v) {
                $this->setJson($k, $v);
            }
            return;
        }

        $this->_jsonData[$key] = $value;
    }
726305
public function add($key, $value)
    {
        if (! isset($this->attributes[$key])) {
            $this->attributes[$key] = array();
        }

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

        return $this;
    }
493801
public function set($attribute, $value = null)
    {
        if (is_array($attribute)) {
            foreach ($attribute as $key => $value) {
                $this[$key] = $value;
            }
        } else {
            $this[$attribute] = $value;
        }
        return $this;
    }
1279013
public function setParam(string $key, $value): Mapping
    {
        $this->_mapping[$key] = $value;

        return $this;
    }
1117248
public function setScriptAttribute(string $key, string $value)
    {
        $this->scriptAttributes[$key] = $value;

        return $this;
    }
119938
public function set($key, $value = null) {
        if (strpos($key, '.') === false) {
            $this->_data[$key] = $value;
        } else {
            $this->_data = Hash::set($this->_data, $key, $value);
        }

        return $this;
    }
753049
public function set($key, $value = null){
        if(is_array($key)){
            $this->_dirty = $key;
        }
        else{
            $this->_dirty[$key] = $value;
        }
        
        return $this;
    }
267166
public function setAttribute($key, $value)
    {
        if (in_array($key, $this->getDates()))
        {
            if ($value)
            {
                $value = $this->fromDateTime($value);
            }
        }

        $this->attributes[$key] = $value;
    }
1256579
function set($key, $value) {
        parent::set($key, $value);
        if($this !== $this->client->emojis) {
            $this->client->emojis->set($key, $value);
        }
        
        return $this;
    }
757170
public function setAttribute($key, $value)
    {
        if (in_array($key, $this->autofillRelationships)) {
            $this->autofilledRelations[camel_case($key)] = $value;
            return $this;
        } else {
            return parent::setAttribute($key, $value);
        }
    }