protected function formatCaseOfValidationMessages($replacements)
    {
        $errorKey = Config('api.errorFormat.errors');
        if (array_key_exists($errorKey, $replacements)) {
            $errorMessages = $replacements[$errorKey];

            if (Config(APIBoilerplate::CASE_TYPE_CONFIG_PATH) == APIBoilerplate::CAMEL_CASE) {
                $errorMessages = camel_case_array_keys($errorMessages);
            } else {
                $errorMessages = snake_case_array_keys($errorMessages);
            }

            $replacements[$errorKey] = $errorMessages;
        }

        return $replacements;
    }
protected function formatCaseOfValidationMessages($replacements)
    {
        $errorKey = Config('api.errorFormat.errors');
        if (array_key_exists($errorKey, $replacements)) {
            $errorMessages = $replacements[$errorKey];

            if (Config(APIBoilerplate::CASE_TYPE_CONFIG_PATH) == APIBoilerplate::CAMEL_CASE) {
                $errorMessages = camel_case_array_keys($errorMessages);
            } else {
                $errorMessages = snake_case_array_keys($errorMessages);
            }

            $replacements[$errorKey] = $errorMessages;
        }

        return $replacements;
    }
protected function formatCaseOfValidationMessages ( $ replacements ) { $ errorKey = Config ( 'api.errorFormat.errors' ) ; if ( array_key_exists ( $ errorKey , $ replacements ) ) { $ errorMessages = $ replacements [ $ errorKey ] ; if ( Config ( APIBoilerplate :: CASE_TYPE_CONFIG_PATH ) == APIBoilerplate :: CAMEL_CASE ) { $ errorMessages = camel_case_array_keys ( $ errorMessages ) ; } else { $ errorMessages = snake_case_array_keys ( $ errorMessages ) ; } $ replacements [ $ errorKey ] = $ errorMessages ; } return $ replacements ; }
Formats the case of validation message keys, if response case is not snake-case

@param array $replacements
@return array
Formats the case of validation message keys if response case is not snake - case