Set a given attribute on the model.


@param  string $key
@param  mixed $value
@return $this
518925
public function setAttribute($key, $value)
    {

        if ($this->timestamp_always_save_in_utc) {
            // set to UTC only if Carbon
            if ($value instanceof Carbon) {
                $value->setTimezone('UTC');
            }
        }

        return parent::setAttribute($key, $value);
    }
1151069
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 (in_array($key, $this->getDates()) && $value) {
			$value = $this->fromDateTime($value);
		}

		// Only set if the user can currently access
		if ($this->console_mode || $this->modify_authorizer->canAccess($key)) {
			if ($this->isJsonCastable($key) && ! is_null($value)) {
				$value = json_encode($value);
			}

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

		return $this;
	}
376335
public function setAttribute($key, $value)
    {
        if ($this->hasSetMutator($key)) {
            $method = 'set' .Str::studly($key) .'Attribute';

            return call_user_func(array($this, $method), $value);
        } else if (in_array($key, $this->getDates()) && $value) {
            $value = $this->fromDateTime($value);
        }

        $this->attributes[$key] = $value;
    }
825065
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' . Helper::studly($key) . 'Attribute';

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

            return;
        }
        if ($this->isJsonCastable($key)) {
            $value = json_encode($value);
        }
        $this->attributes[$key] = $value;
    }
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);
    }
161056
public function addAttribute($key, $value = true)
    {
        if ($value === null) {
            return $this;
        }
        $this->attributes[$key] = $value;

        return $this;
    }
581861
public function attribute($key, $value = null) {
        if (is_array($key)) {
            $this->_attributes = array_replace($this->_attributes, $key);
        } else {
            $this->_attributes[$key] = $value;
        }

        return $this;
    }
916861
public function setAttribute($key, $value){
        return $this->cache->store($this->prefixApp . $key, $value);
    }
68377
public function setAttribute($key, $value)
    {
        if ($this->hasSetMutator($key)) {
            $method = 'set'.Str::studly($key).'Attribute';

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

        $this->model->attributes[$key] = $value;
    }
1110799
public function setAttribute(string $key, string $value)
    {
        if ($this->valid($key, $value)) {
            $value = encrypt($value);
        }

        return parent::setAttribute($key, $value);
    }
86034
public function set($key, $value): self
    {
        if ($key === null) { // $x[] = ..
            $this->data[] = $value;
        } else {
            Arrays::set($this->data, $key, $value);
        }

        return $this;
    }
734781
public function set(string $key, $value): Definition
    {
        $this->data[$key] = $value;

        return $this;
    }
1198646
public function set(string $key, $value): self
    {
        $this->data[$key] = $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;
	}
470713
public function set( $key, $value ) {
		$key = $this->addKeyprefixIfNeeded( $key );
		$this->params[$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);
        }
    }