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);
                }
            }
        }
    }
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);
                }
            }
        }
    }
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 ) ; } } } }
Check if value is not set and set it.

@param string|array|null $value
@return void
Check if value is not set and set it .