// ValidatesAttributes.php
protected function requireSameType($first, $second)
{
if (gettype($first) != gettype($second)) {
throw new InvalidArgumentException('The values under comparison must be of the same type');
}
}
So just do a dd() there to see what exactly the function is getting.
So I've got it. If the less_than value is missing, then the required rule for the more_than is valid. Then the more_than will get to the greater than rule and try to access the less_than value, which is null and thus the types don't match. To make it work you have to make it a two stage check:
@SGUserFace what do you mean a two stage? Just write it exactly as I wrote it. It works. If any of the fields fail the first check you'll get the error immediately, else the request will be validated with the second set of rules.