public function setAttribute($key, $value)
    {
        if (in_array($key, $this->getTranslatable())) {
            $translation = $this->translateOrNew($this->getLocale());

            $translation->$key = $value;

            $this->translationCache[$this->getLocale()] = $translation;

            return $translation;
        }

        return parent::setAttribute($key, $value);
    }
public function setAttribute($key, $value)
    {
        if (in_array($key, $this->getTranslatable())) {
            $translation = $this->translateOrNew($this->getLocale());

            $translation->$key = $value;

            $this->translationCache[$this->getLocale()] = $translation;

            return $translation;
        }

        return parent::setAttribute($key, $value);
    }
public function setAttribute ( $ key , $ value ) { if ( in_array ( $ key , $ this -> getTranslatable ( ) ) ) { $ translation = $ this -> translateOrNew ( $ this -> getLocale ( ) ) ; $ translation -> $ key = $ value ; $ this -> translationCache [ $ this -> getLocale ( ) ] = $ translation ; return $ translation ; } return parent :: setAttribute ( $ key , $ value ) ; }
Set a given attribute on the model or translation.

@param string $key
@param mixed $value

@return $this
Set a given attribute on the model or translation .