src/Str.php
public function convertToArray($string, $value)
    {
        $keys = explode('.', $string);

        return $this->buildDimensionalArray($keys, count($keys), $value);
    }
public function convertToArray($string, $value)
    {
        $keys = explode('.', $string);

        return $this->buildDimensionalArray($keys, count($keys), $value);
    }
Convert dotted string to a nested array.
Append the value to the last nested array.

@param string $string
@param string $value

@return string|array