Set a given attribute on the model.

@param  string  $key
@param  mixed  $value
@return $this
2780
public function setAttribute($key, $value)
    {
        if ($value !== null && $this->hasEnumCast($key)) {
            $enum = $this->enumCasts[$key];

            if ($value instanceOf $enum) {
                $this->attributes[$key] = $value->value;
            } else {
                $this->attributes[$key] = $enum::getInstance($value)->value;
            }

            return $this;
        }

        parent::setAttribute($key, $value);
    }
1212629
public function set($key, $value)
    {
        if (!is_string($key)) {
            throw new ClientException('Invalid attribute key');
        }

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

        return $this;
    }
560159
public function setAttribute($key, $value)
    {
        $this->findUploadFields();

        if ($this->isUploadField($key)) {
            list($method, $originalKey) = $this->uploadSetKeys[$key];

            if ($this->hasSetMutator($key)) {
                $method = 'set'.Str::studly($key).'Attribute';

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

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

        return parent::setAttribute($key, $value);
    }
192100
public function set($key, $value) {
    if ($this->exists($key)) {
      $index = $this->getKeyPosition($key);
      $this->values[$index] = $value;
      return $this;
    }
    return $this->add($key, $value);
  }
1121922
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' . Str::studly($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.
        if ($value && $this->isDateAttribute($key)) {
            $value = $this->fromDateTime($value);
        }

        if ($this->isJsonCastable($key) && !is_null($value)) {
            $value = $this->asJson($value);
        }

        // If this attribute contains a JSON ->, we'll set the proper value in the
        // attribute's underlying array. This takes care of properly nesting an
        // attribute in the array's value in the case of deeply nested items.
        if (Str::contains($key, '->')) {
            return $this->fillJsonAttribute($key, $value);
        }

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

        return $this;
    }
522903
function set($key, $value) {
        if(!$this->enabled) {
            return $this;
        }
        
        parent::set($key, $value);
        return $this;
    }
920671
public function set($name, $value)
    {
        if ( !$value ) {
            $this->attributes->remove($name);

            return $this;
        }
        $this->attributes->set($name, $value);

        return $this;
    }
144778
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' . Str::studly( $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 ( $value && ( in_array( $key, $this->getDates() ) || $this->isDateCastable( $key ) ) )
		{
			$value = $this->fromDateTime( $value );
		}

		if ( $this->isJsonCastable( $key ) && !is_null( $value ) )
		{
			$value = $this->asJson( $value );
		}

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

		return $this;
	}
430654
public function attribute($key, $value)
    {
        if (! in_array($key, $this->allowedAttributes)) {
            throw new InvalidArgumentException("Attribute [{$key}] does not exist.");
        }

        $this->attributes[Arr::get($this->aliases, $key, $key)] = $value;

        return $this;
    }
19913
public function set($key, $value)
    {
        $keys = explode('.', $key);

        $data = &$this->parameters;

        while (count($keys) > 1) {
            $pkey = $keys[0];

            if (!array_key_exists($pkey, $data) || !is_array($data[$pkey])) {
                $data[$pkey] = [];
            }

            $data = &$data[$pkey];
            array_shift($keys);
        }

        $data[$keys[0]] = $value;

        return $this;
    }
290020
public function set($key, $value)
	{
		Arr::set($this->body, $key, $value);

		return $this;
	}
922350
public function setAttribute($key, $value)
    {
        if (array_key_exists($key, $this->getMediaFiles())) {
            if ($value) {
                $this->media_files[$key]
                    ->setUploadedFile($value, $key);
            }

            return $this;
        }

        return parent::setAttribute($key, $value);
    }
992812
function set($key, $value) {
        parent::set($key, $value);
        if($this !== $this->client->users) {
            $this->client->users->set($key, $value);
        }
        
        return $this;
    }
459551
public function setAttribute(string $attribute, $value = []): self
    {
        $this->attributes[$attribute] = $this->wrap($value);

        return $this;
    }
1105945
public function setAttribute( $key, $value )
	{
		if( $this->getAttribute( $key ) === (string) $value )
			return FALSE;
		$this->attributes[$key] = (string) $value;
		return TRUE;
	}
1323784
protected function setParameter($key, $value)
    {
        if (is_array($value) && isset($value['value'])) {
            $value = $value['value'];
        }

        $this->parameters->set($key, $value);

        return $this;
    }
1171607
public function setAttribute($key, $value)
    {
        return ( ! $this->isTranslatableAttribute($key) || is_array($value))
            ? parent::setAttribute($key, $value)
            : $this->setTranslation($key, $this->getLocale(), $value);
    }