private function snakeCase($key)
    {
        if (! ctype_lower($key)) {
            $key = preg_replace('/\s+/u', '', $key);
            $key = mb_strtolower(preg_replace('/(.)(?=[A-Z])/u', '$1' . '_', $key), 'UTF-8');
        }

        return $key;
    }