Replace all error message place-holders with actual values.

@param  string  $message
@param  string  $attribute
@param  string  $rule
@param  array   $parameters
@return string
327769
public function makeReplacements($message, $attribute, $rule, $parameters)
    {
        $message = $this->replaceAttributePlaceholder(
            $message, $this->getDisplayableAttribute($attribute)
        );

        $message = $this->replaceInputPlaceholder($message, $attribute);

        if (isset($this->replacers[Str::snake($rule)])) {
            return $this->callReplacer($message, $attribute, Str::snake($rule), $parameters, $this);
        } elseif (method_exists($this, $replacer = "replace{$rule}")) {
            return $this->$replacer($message, $attribute, $rule, $parameters);
        }

        return $message;
    }
70822
protected function callClassBasedReplacer($callback, $message, $attribute, $rule, $parameters)
    {
        list($class, $method) = explode('@', $callback);

        $instance = $this->container->make($class);

        return call_user_func_array(array($instance, $method), array_slice(func_get_args(), 1));
    }
56391
protected function replaceRequiredWithout($message, $attribute, $rule, $parameters)
    {
        return $this->replaceRequiredWith($message, $attribute, $rule, $parameters);
    }
532612
public function validateMimes($attribute, $value, $parameters)
    {
        if (! $this->isValidFileInstance($value)) {
            return false;
        }

        if ($this->shouldBlockPhpUpload($value, $parameters)) {
            return false;
        }

        return $value->getPath() !== '' && in_array($value->guessExtension(), $parameters);
    }
220644
protected function validate( $attribute, $rule )
	{
		list( $rule, $parameters ) = $this->parseRule( $rule );

		if ( $rule == '' )
		{
			return;
		}

		// First we will get the correct keys for the given attribute in case the field is nested in
		// an array. Then we determine if the given rule accepts other field names as parameters.
		// If so, we will replace any asterisks found in the parameters with the correct keys.
		if ( ( $keys = $this->getExplicitKeys( $attribute ) ) && $this->dependsOnOtherFields( $rule ) )
		{
			$parameters = $this->replaceAsterisksInParameters( $parameters, $keys );
		}

		// We will get the value for the given attribute from the array of data and then
		// verify that the attribute is indeed validatable. Unless the rule implies
		// that the attribute is required, rules are not run for missing values.
		$value = $this->getValue( $attribute );

		$validatable = $this->isValidatable( $rule, $attribute, $value );

		$method = "validate{$rule}";

		if ( $validatable && !$this->$method( $attribute, $value, $parameters, $this ) )
		{
			$this->addFailure( $attribute, $rule, $parameters );
		}
	}
854832
protected function replaceDifferent($message, $attribute, $rule, $parameters)
    {
        return $this->replaceSame($message, $attribute, $rule, $parameters);
    }
121874
protected function addError($attribute, $message)
    {
        if (!isset($this->errors[$attribute])) {
            $this->errors[$attribute] = array();
        }
        $this->errors[$attribute][] = $message;
    }
652672
protected function replaceDigitsBetween($message, $attribute, $rule, $parameters)
    {
        return $this->replaceBetween($message, $attribute, $rule, $parameters);
    }
184068
public function replaceImageSize($message, $attribute, $rule, $parameters)
    {
        $width = $height = $this->checkDimension($parameters[0]);
        if (isset($parameters[1])) {
            $height = $this->checkDimension($parameters[1]);
        }

        return str_replace(
            [':width', ':height'],
            [$width['message'], $height['message']],
            $message
        );
    }
648499
protected function getDefaultErrorMessage($laravelRule, $attribute)
    {
        // getting user friendly validation message
        $message = $this->message()->getValidationMessage($attribute, $laravelRule);

        return ['data-msg-'.$laravelRule => $message];
    }
1174336
protected function validateMin( $value, $attribute, array $parameters )
	{
		$this->requireParameterCount( 1, $parameters, 'min' );

		return $this->getSize( $attribute, $value ) >= $parameters[0];
	}
413026
protected function replaceAfter($message, $attribute, $rule, $parameters)
    {
        return $this->replaceBefore($message, $attribute, $rule, $parameters);
    }
1328580
protected function translator( $key, $rule, $attribute, array $parameters )
	{
		$strings = [];//glsr_resolve( 'Strings' )->validation();

		$message = isset( $strings[$key] )
			? $strings[$key]
			: false;

		if( !$message )return;

		$message = str_replace( ':attribute', $attribute, $message );

		if( method_exists( $this, $replacer = "replace{$rule}" )) {
			$message = $this->$replacer( $message, $parameters );
		}

		return $message;
	}
908834
protected function getErrorMessage($laravelRule, $attribute)
	{
		// getting user friendly attribute name
		$attribute = $this->getAttributeName($attribute);
		$message = Lang::get('validation.'.$laravelRule, ['attribute' => $attribute]);

		return ['data-msg-'.$laravelRule => $message];
	}
891082
protected function validateUsingCustomRule($attribute, $value, $rule)
    {
        if (! $rule->passes($attribute, $value)) {
            $this->failedRules[$attribute][get_class($rule)] = [];

            $messages = (array) $rule->message();

            foreach ($messages as $message) {
                $this->messages->add($attribute, $this->makeReplacements(
                    $message, $attribute, get_class($rule), []
                ));
            }
        }
    }
1120122
protected function validateAttribute($attribute, $rule)
    {
        $this->currentRule = $rule;

        [$rule, $parameters] = ValidationRuleParser::parse($rule);

        if ($rule == '') {
            return;
        }

        // First we will get the correct keys for the given attribute in case the field is nested in
        // an array. Then we determine if the given rule accepts other field names as parameters.
        // If so, we will replace any asterisks found in the parameters with the correct keys.
        if (($keys = $this->getExplicitKeys($attribute)) &&
            $this->dependsOnOtherFields($rule)) {
            $parameters = $this->replaceAsterisksInParameters($parameters, $keys);
        }

        $value = $this->getValue($attribute);

        // If the attribute is a file, we will verify that the file upload was actually successful
        // and if it wasn't we will add a failure for the attribute. Files may not successfully
        // upload if they are too large based on PHP's settings so we will bail in this case.
        if ($value instanceof UploadedFile && ! $value->isValid() &&
            $this->hasRule($attribute, array_merge($this->fileRules, $this->implicitRules))
        ) {
            return $this->addFailure($attribute, 'uploaded', []);
        }

        // If we have made it this far we will make sure the attribute is validatable and if it is
        // we will call the validation method with the attribute. If a method returns false the
        // attribute is invalid and we will add a failure message for this failing attribute.
        $validatable = $this->isValidatable($rule, $attribute, $value);

        if ($rule instanceof RuleContract) {
            return $validatable
                    ? $this->validateUsingCustomRule($attribute, $value, $rule)
                    : null;
        }

        $method = "validate{$rule}";

        if ($validatable && ! $this->$method($attribute, $value, $parameters, $this)) {
            $this->addFailure($attribute, $rule, $parameters);
        }
    }
394374
protected function doReplacements($message, $attribute, $rule, $parameters)
    {
        $message = str_replace(':attribute', $this->getAttribute($attribute), $message);

        $replacer = Str::snake($rule);

        if (isset($this->replacers[$replacer])) {
            $message = $this->callReplacer($message, $attribute, $replacer, $parameters);
        } else if (method_exists($this, $replacer = "replace{$rule}")) {
            $message = call_user_func(array($this, $replacer), $message, $attribute, $rule, $parameters);
        }

        return $message;
    }