private function getErrorMessage($translator, $messages, $key)
    {
        // return error messages passed directly to the validator
        if (isset($messages[$key])) {
            return $messages[$key];
        }

        // return error message from validation translation file
        if ($translator->has("validation.{$key}")) {
            return $translator->get("validation.{$key}");
        }

        // return packages default message
        return $translator->get("validation::validation.{$key}");
    }
private function getErrorMessage($translator, $messages, $key)
    {
        // return error messages passed directly to the validator
        if (isset($messages[$key])) {
            return $messages[$key];
        }

        // return error message from validation translation file
        if ($translator->has("validation.{$key}")) {
            return $translator->get("validation.{$key}");
        }

        // return packages default message
        return $translator->get("validation::validation.{$key}");
    }
private function getErrorMessage ( $ translator , $ messages , $ key ) { // return error messages passed directly to the validator if ( isset ( $ messages [ $ key ] ) ) { return $ messages [ $ key ] ; } // return error message from validation translation file if ( $ translator -> has ( "validation.{$key}" ) ) { return $ translator -> get ( "validation.{$key}" ) ; } // return packages default message return $ translator -> get ( "validation::validation.{$key}" ) ; }
Return the matching error message for the key

@param  string $key
@return string
Return the matching error message for the key