Overtrue\Validation\Validator::validateBefore PHP Method

validateBefore() protected method

Validate the date is before a given date.
protected validateBefore ( string $attribute, mixed $value, array $parameters ) : boolean
$attribute string
$value mixed
$parameters array
return boolean
    protected function validateBefore($attribute, $value, $parameters)
    {
        $this->requireParameterCount(1, $parameters, 'before');
        if ($format = $this->getDateFormat($attribute)) {
            return $this->validateBeforeWithFormat($format, $value, $parameters);
        }
        if (!($date = strtotime($parameters[0]))) {
            return strtotime($value) < strtotime($this->getValue($parameters[0]));
        } else {
            return strtotime($value) < $date;
        }
    }
Validator