src/UniqueTranslationValidator.php
protected function getMessage($validator, $rule, $name, $locale)
    {
        $keys = [
            "{$name}.{$rule}",
            "{$name}.*.{$rule}",
            "{$name}.{$locale}.{$rule}",
        ];

        foreach ($keys as $key) {
            if (array_key_exists($key, $validator->customMessages)) {
                return $validator->customMessages[$key];
            }
        }

        return trans('validation.unique');
    }
protected function getMessage($validator, $rule, $name, $locale)
    {
        $keys = [
            "{$name}.{$rule}",
            "{$name}.*.{$rule}",
            "{$name}.{$locale}.{$rule}",
        ];

        foreach ($keys as $key) {
            if (array_key_exists($key, $validator->customMessages)) {
                return $validator->customMessages[$key];
            }
        }

        return trans('validation.unique');
    }
protected function getMessage ( $ validator , $ rule , $ name , $ locale ) { $ keys = [ "{$name}.{$rule}" , "{$name}.*.{$rule}" , "{$name}.{$locale}.{$rule}" , ] ; foreach ( $ keys as $ key ) { if ( array_key_exists ( $ key , $ validator -> customMessages ) ) { return $ validator -> customMessages [ $ key ] ; } } return trans ( 'validation.unique' ) ; }
Get any custom message from the validator or return a default message.

@param \Illuminate\Validation\Validator $validator
@param string $rule
@param string $name
@param string $locale

@return string
Get any custom message from the validator or return a default message .