public function getMessages(): array
    {
        $errors = $this->getErrors();

        $keys = array_keys($errors);

        return array_reduce($keys, function ($messages, $key) use ($errors) {

            $translated = $this->translator->getMessages($key, $errors[$key]);

            return array_merge($messages, $translated);

        }, []);
    }
public function getMessages(): array
    {
        $errors = $this->getErrors();

        $keys = array_keys($errors);

        return array_reduce($keys, function ($messages, $key) use ($errors) {

            $translated = $this->translator->getMessages($key, $errors[$key]);

            return array_merge($messages, $translated);

        }, []);
    }
public function getMessages ( ) : array { $ errors = $ this -> getErrors ( ) ; $ keys = array_keys ( $ errors ) ; return array_reduce ( $ keys , function ( $ messages , $ key ) use ( $ errors ) { $ translated = $ this -> translator -> getMessages ( $ key , $ errors [ $ key ] ) ; return array_merge ( $ messages , $ translated ) ; } , [ ] ) ; }
Return a list of translated error messages.

@return array
Return a list of translated error messages .