protected function validate(Validator $v) { $v->whenSet(function (Validator $v) { $v->notDateTime('The value is not a valid Date and Time string'); }); return parent::validate($v); }
protected function validate(Validator $v) { $v->whenNotNull(function (Validator $v) { $v->allow(function (Validator $v) { $v->notInt('The value is not a valid UNIX-TimeStamp'); })->allow(function (Validator $v) { $v->notDateTime('The value is not a valid Date and Time string'); })->notPassed('The value is not a valid Date and/or Time'); }); }