Respect\Validation\Exceptions\NestedValidationException::findMessages PHP Method

findMessages() public method

public findMessages ( array $paths ) : self
$paths array
return self
    public function findMessages(array $paths)
    {
        $messages = [];
        foreach ($paths as $key => $value) {
            $numericKey = is_numeric($key);
            $path = $numericKey ? $value : $key;
            if (!($exception = $this->getRelatedByName($path))) {
                $exception = $this->findRelated($path);
            }
            $path = str_replace('.', '_', $path);
            if (!$exception) {
                $messages[$path] = '';
                continue;
            }
            $exception = $this->getExceptionForPath($path, $exception);
            if (!$numericKey) {
                $exception->setTemplate($value);
            }
            $messages[$path] = $exception->getMainMessage();
        }
        return $messages;
    }