Validate the date is before a given date.

@param  string  $attribute
@param  mixed   $value
@param  array   $parameters
@return bool
505852
protected function validateBefore($attribute, $value, $parameters)
	{
		if ( ! ($date = strtotime($parameters[0])))
		{
			return strtotime($value) < strtotime($this->getValue($parameters[0]));
		}
		else
		{
			return strtotime($value) < $date;
		}
	}
56
public function validateGt($attribute, $value, $parameters)
    {
        $this->requireParameterCount(1, $parameters, 'gt');

        $comparedToValue = $this->getValue($parameters[0]);

        $this->shouldBeNumeric($attribute, 'Gt');

        if (is_null($comparedToValue) && (is_numeric($value) && is_numeric($parameters[0]))) {
            return $this->getSize($attribute, $value) > $parameters[0];
        }

        if (! $this->isSameType($value, $comparedToValue)) {
            return false;
        }

        return $this->getSize($attribute, $value) > $this->getSize($attribute, $comparedToValue);
    }
431613
public function validateSweetcaptcha($attribute, $value, $parameters)
    {

        if (Input::has('scvalue'))
        {	
        	$sweetcaptcha = app()->make('SweetCaptcha');        	
        	return $sweetcaptcha->check(array('sckey' => $value, 'scvalue' => Input::get('scvalue'))) == "true";
    	}
    	else
    		return false;
    }
144836
protected function validateDigits($attribute, $value, $parameters)
    {
        $this->requireParameterCount(1, $parameters, 'digits');

        return $this->validateNumeric($attribute, $value)
            && strlen((string) $value) == $parameters[0];
    }
1155221
protected function validateDateFormat($attribute, $value, $parameters)
	{
		$parsed = date_parse_from_format($parameters[0], $value);

		return $parsed['error_count'] === 0 && $parsed['warning_count'] === 0;
	}
704666
protected function validateAfter( $attribute, $value, $parameters )
	{
		$this->requireParameterCount( 1, $parameters, 'after' );

		if ( !is_string( $value ) && !is_numeric( $value ) && !$value instanceof DateTimeInterface )
		{
			return false;
		}

		if ( $format = $this->getDateFormat( $attribute ) )
		{
			return $this->validateAfterWithFormat( $format, $value, $parameters );
		}

		if ( !$date = $this->getDateTimestamp( $parameters[0] ) )
		{
			$date = $this->getDateTimestamp( $this->getValue( $parameters[0] ) );
		}

		return $this->getDateTimestamp( $value ) > $date;
	}
1122823
protected function _validate_date($value, $parameter = null)
    {
        $context = $this->_context;

        $ts = is_numeric($value) ? (int)$value : strtotime($value);
        if ($ts === false) {
            return null;
        }

        $r = date($context->model->getDateFormat($context->field), $ts);
        return $r !== false ? $r : null;
    }
327795
protected function validateMax($attribute, $value, $parameters)
    {
        $this->requireParameterCount(1, $parameters, 'max');

        if (!empty($value['tmp_name']) && is_uploaded_file($value['tmp_name']) && $value['error']) {
            return false;
        }

        return $this->getSize($attribute, $value) <= $parameters[0];
    }
692707
public function validateRequiredWithoutAll($attribute, $value, $parameters)
    {
        if ($this->allFailingRequired($parameters)) {
            return $this->validateRequired($attribute, $value);
        }

        return true;
    }
894050
protected function validateMimes($attribute, $value, $parameters)
	{
		if ( ! $value instanceof File || $value->getPath() == '')
		{
			return true;
		}

		// The Symfony File class should do a decent job of guessing the extension
		// based on the true MIME type so we'll just loop through the array of
		// extensions and compare it to the guessed extension of the files.
		return in_array($value->guessExtension(), $parameters);
	}
352244
public function validateVideoLink($attribute, $value, $parameters, $validator)
    {
        return preg_match($this->youtubeRegex, $value) || preg_match($this->vimeoRegex, $value);
    }
1267214
public function validateTimezone($attribute, $value)
    {
        try {
            new DateTimeZone($value);
        } catch (Exception $e) {
            return false;
        } catch (Throwable $e) {
            return false;
        }

        return true;
    }
1270786
public function validateRequiredWithAll($attribute, $value, $parameters)
    {
        if (! $this->anyFailingRequired($parameters)) {
            return $this->validateRequired($attribute, $value);
        }

        return true;
    }
1345915
public function validate($attribute, $value, $parameters, $validator)
    {
        list ($name, $locale) = $this->getAttributeNameAndLocale($attribute);

        if ($this->isUnique($value, $name, $locale, $parameters)) {
            return true;
        }

        $this->addErrorsToValidator($validator, $parameters, $name, $locale);

        return false;
    }
1174336
protected function validateMin( $value, $attribute, array $parameters )
	{
		$this->requireParameterCount( 1, $parameters, 'min' );

		return $this->getSize( $attribute, $value ) >= $parameters[0];
	}
450554
public function validateUnique($attribute, $value, $parameters)
    {
        $this->requireParameterCount(1, $parameters, 'unique');

        [$connection, $table] = $this->parseTable($parameters[0]);

        // The second parameter position holds the name of the column that needs to
        // be verified as unique. If this parameter isn't specified we will just
        // assume that this column to be verified shares the attribute's name.
        $column = $this->getQueryColumn($parameters, $attribute);

        [$idColumn, $id] = [null, null];

        if (isset($parameters[2])) {
            [$idColumn, $id] = $this->getUniqueIds($parameters);

            if (! is_null($id)) {
                $id = stripslashes($id);
            }
        }

        // The presence verifier is responsible for counting rows within this store
        // mechanism which might be a relational database or any other permanent
        // data store like Redis, etc. We will use it to determine uniqueness.
        $verifier = $this->getPresenceVerifierFor($connection);

        $extra = $this->getUniqueExtra($parameters);

        if ($this->currentRule instanceof Unique) {
            $extra = array_merge($extra, $this->currentRule->queryCallbacks());
        }

        return $verifier->getCount(
            $table, $column, $value, $id, $idColumn, $extra
        ) == 0;
    }
1183229
public function validateClamav($attribute, $value, $parameters)
    {
        $file = $this->getFilePath($value);
        $clamavSocket = $this->getClamavSocket();

        // Create a new socket instance
        $socket = (new Factory())->createClient($clamavSocket);

        // Create a new instance of the Client
        $quahog = new Client($socket, self::CLAMAV_SOCKET_READ_TIMEOUT, PHP_NORMAL_READ);

        // Check if the file is readable
        if (! is_readable($file)) {
            throw new ClamavValidatorException(sprintf('The file "%s" is not readable', $file));
        }

        // Scan the file
        $result = $quahog->scanResourceStream(fopen($file, 'rb'));

        if (self::CLAMAV_STATUS_ERROR === $result['status']) {
            throw new ClamavValidatorException($result['reason']);
        }

        // Check if scan result is not clean
        return !(self::CLAMAV_STATUS_OK !== $result['status']);
    }