public static function set(array &$array, string $key, $value, bool $create = false): void
    {
        // Extract key/path.
        $keyLast = Str::last($key, '.');
        $key = Str::removeLast($key, '.');

        // Extract data.
        $pathArray = null;
        if ($key !== '' && $key !== null) {
            $array = &self::dataByPath($array, $key, $create);
        }
        if ($array !== null || $create) {
            $array[$keyLast] = $value;
        }
    }