public function store(Model $model, $source, $value)
    {
        if ( ! $this->isTranslated()) {
            $this->performStore($model, $source, $value);
            return;
        }

        /** @var Model|Translatable $model */

        if ( ! is_array($value)) {
            throw new UnexpectedValueException("Value should be in per-locale array format for translatable data");
        }

        foreach ($value as $locale => $singleValue) {

            // Safeguard: use empty string if non-nullable translated field is null
            if (null === $singleValue && ! $this->isNullable()) {
                $singleValue = '';
            }

            $this->performStore($model->translateOrNew($locale), $source, $singleValue);
        }
    }
public function store(Model $model, $source, $value)
    {
        if ( ! $this->isTranslated()) {
            $this->performStore($model, $source, $value);
            return;
        }

        /** @var Model|Translatable $model */

        if ( ! is_array($value)) {
            throw new UnexpectedValueException("Value should be in per-locale array format for translatable data");
        }

        foreach ($value as $locale => $singleValue) {

            // Safeguard: use empty string if non-nullable translated field is null
            if (null === $singleValue && ! $this->isNullable()) {
                $singleValue = '';
            }

            $this->performStore($model->translateOrNew($locale), $source, $singleValue);
        }
    }
public function store ( Model $ model , $ source , $ value ) { if ( ! $ this -> isTranslated ( ) ) { $ this -> performStore ( $ model , $ source , $ value ) ; return ; } /** @var Model|Translatable $model */ if ( ! is_array ( $ value ) ) { throw new UnexpectedValueException ( "Value should be in per-locale array format for translatable data" ) ; } foreach ( $ value as $ locale => $ singleValue ) { // Safeguard: use empty string if non-nullable translated field is null if ( null === $ singleValue && ! $ this -> isNullable ( ) ) { $ singleValue = '' ; } $ this -> performStore ( $ model -> translateOrNew ( $ locale ) , $ source , $ singleValue ) ; } }
Stores a submitted value on a model

@param Model  $model
@param string $source
@param mixed  $value
Stores a submitted value on a model