src/Validation.php
public function getConcatMessage($field = null, string $sep = ' ', bool $punctuate = true): string {
        $sentence = $this->translate('%s.');

        $errors = $field === null ? $this->getRawErrors() : ($this->errors[$field] ?? []);

        // Generate the message by concatenating all of the errors together.
        $messages = [];
        foreach ($errors as $field => $error) {
            $message = $this->formatErrorMessage($error + ['field' => $field]);
            if ($punctuate && preg_match('`\PP$`u', $message)) {
                $message = sprintf($sentence, $message);
            }
            $messages[] = $message;
        }
        return implode($sep, $messages);
    }
public function getConcatMessage($field = null, string $sep = ' ', bool $punctuate = true): string {
        $sentence = $this->translate('%s.');

        $errors = $field === null ? $this->getRawErrors() : ($this->errors[$field] ?? []);

        // Generate the message by concatenating all of the errors together.
        $messages = [];
        foreach ($errors as $field => $error) {
            $message = $this->formatErrorMessage($error + ['field' => $field]);
            if ($punctuate && preg_match('`\PP$`u', $message)) {
                $message = sprintf($sentence, $message);
            }
            $messages[] = $message;
        }
        return implode($sep, $messages);
    }
public function getConcatMessage ( $ field = null , string $ sep = ' ' , bool $ punctuate = true ) : string { $ sentence = $ this -> translate ( '%s.' ) ; $ errors = $ field === null ? $ this -> getRawErrors ( ) : ( $ this -> errors [ $ field ] ?? [ ] ) ; // Generate the message by concatenating all of the errors together. $ messages = [ ] ; foreach ( $ errors as $ field => $ error ) { $ message = $ this -> formatErrorMessage ( $ error + [ 'field' => $ field ] ) ; if ( $ punctuate && preg_match ( '`\PP$`u' , $ message ) ) { $ message = sprintf ( $ sentence , $ message ) ; } $ messages [ ] = $ message ; } return implode ( $ sep , $ messages ) ; }
Generate a global error string by concatenating field errors.

@param string|null $field The name of a field to concatenate errors for.
@param string $sep The error message separator.
@param bool $punctuate Whether or not to automatically add punctuation to errors if they don't have it already.
@return string Returns an error message.
Generate a global error string by concatenating field errors .