protected function flatCollection(array $data, string $prefix = null, array $flat_data = []): array
    {
        foreach ($data as $key => $val) {
            if ($prefix !== null) {
                $key = $prefix.$this->separator.$key;
            }

            $skip_key = $this->skipKey($key);

            if (is_array($val)) {
                $flat_data = array_merge(
                    $flat_data,
                    $this->flatCollection($val, (string) $key)
                );
                continue;
            }

            if ($skip_key) {
                continue;
            }

            $flat_data[$key] = $val;
        }

        return $flat_data;
    }