public function setValue($value, $index = null)
    {
        if ($index === null) {
            $this->value = Arr::cast($value);
        }
        else {
            $this->value[$index] = $value;
        }
        return $this;
    }
public function setValue($value, $index = null)
    {
        if ($index === null) {
            $this->value = Arr::cast($value);
        }
        else {
            $this->value[$index] = $value;
        }
        return $this;
    }
public function setValue ( $ value , $ index = null ) { if ( $ index === null ) { $ this -> value = Arr :: cast ( $ value ) ; } else { $ this -> value [ $ index ] = $ value ; } return $ this ; }
Set one or all values

@param string|integer|float|array<string|integer|float> $value
@param integer|null $index
@return \sndsgd\Field
Set one or all values