Check if value is not set and set it.

@param string|array|null $value
@return void
161264
public function setDefaultValue($value = null)
    {
        if (! $this->value) {
            if ($value = $value ?: config("fields.values.{$this->key}")) {
                foreach ((array) $value as $locale => $translation) {
                    $locale = is_string($locale) ? $locale : $this->getDefaultLocale();
                    $this->setTranslation('value', $translation, $locale);
                    $this->addTranslated($locale);
                }
            }
        }
    }
27955
public function setValue($value)
    {
        if (!$this->isValid($value)) {
            throw new \UnexpectedValueException("Value '$value' is not part of the enum ".get_called_class());
        }
        $this->value = $value;
    }
1062368
public function setCreated($value)
    {
        $this->_validateDate('Created', $value);

        if ($this->data['created'] === $value) {
            return;
        }

        $this->data['created'] = $value;

        $this->_setModified('created');
    }
601745
public function setValue($value)
	{
		if ( $value == $this->getValue() ) {
			return;
		}

		$this->_values['value'] = (string) $value;

		$this->setModified();
	}
1117195
public function isValid($value)
    {
        if (parent::isValid($value)) {
            $this->setValue($value);

            $this->error(self::IN_ARRAY);

            return false;
        }

        return true;
    }
1363274
public function set($key, $value = null)
    {
        if (!$this->checkExtraColumns()) {
            return;
        }

        $this->load();
        $this->unsaved = true;

        if (is_array($key)) {
            foreach ($key as $k => $v) {
                Arr::set($this->data, $k, $v);
            }
        } else {
            Arr::set($this->data, $key, $value);
        }
    }
98446
public function setPlugin($value)
    {
        $this->_validateNotNull('Plugin', $value);
        $this->_validateString('Plugin', $value);

        if ($this->data['plugin'] === $value) {
            return;
        }

        $this->data['plugin'] = $value;

        $this->_setModified('plugin');
    }
28841
public function setValue(string $value) : void
    {
        $this->value = $value;
        foreach ((array)$this as $option) {
            if ($option->getValue() == $value) {
                $option->selected();
            } else {
                $option->unselected();
            }
        }
    }
417004
public function setValue($value)
    {
        if (is_array($value) && isset($value[0]) && $value[0] instanceof DateTimeInterface) {
            $this->setDateTimes($value);
        } elseif ($value instanceof DateTimeInterface) {
            $this->setDateTimes([$value]);
        } else {
            parent::setValue($value);
        }
    }
892539
public function setFlags( $value )
	{
		if ( $value == $this->getFlags() ) { return; }

		$this->_checkFlags($value);
		$this->_values['flags'] = (int) $value;
		$this->setModified();
	}
317736
function setValue($value)
    {
        $this->setChecked(isset($this->_values[1]) && $value == $this->_values[1]);
        $this->_currentValue = $value;
    }
534337
protected function checkValue($value, $key = null)
    {
        if ($value != null) {
            if ($key !== null) {
                return isset($value[$key]) ? $value[$key] : null;
            }

            return $value;
        }
    }
606676
public function load($value = null)
    {
        if (is_array($value)) {
            $this->loadFromArray($value);
        } elseif (is_string($value) && file_exists($value)){
            $this->loadFromFile($value);
        }
    }
1256649
protected function setValue($value)
    {
        if ($value === self::UNSUBSCRIBE)
        {
            $this->value = self::UNSUBSCRIBE;
        } else {
            $this->value = self::SUBSCRIBE;
        }
    }
514287
public function setValue($value)
    {
        $this->clearCachedValueIf($this->value != $value);
        $this->value = $value;
    }
1043305
private function checkValue($value){


        $check = $this->getPossibleValueArray();
        if (!is_array($check) || empty($check)){
            $this->handleError("No Check Array defined (getPossibleValueArray())",  EnumException::NoEnumsDefined);
        }
        if (!in_array($value, $check)){
            $this->handleError("Invalid Value", EnumException::Invalidvalue);
        }
    }
48314
public function set($key, $value = null)
    {
        $keys = is_array($key) ? $key : [$key => $value];

        foreach ($keys as $key => $value) {
            Arr::set($this->items, $key, $value);
        }
    }