Hey, I have a validator rule like this:
$validator->make($_POST, 'dateOfBirth'=>'date:Y/m/d|before:today' );
As you can see, the date field is not required, it is optional, but if someone wants to enter it, it must be in the given format and before today. The problem is when the user leaves the field empty, we get an error that says:
... Argument #1 ($date) must be of type string, null given, called in ...
So you get the point. I am pretty sure we should leave checking the value for empty/null values for the "required" rule and return true if the field is empty, in "before and after" rules.