Validate the date is before or equal a given date.

@param  string  $attribute
@param  mixed   $value
@param  array   $parameters
@return bool
164695
public function validateBeforeOrEqual($attribute, $value, $parameters)
    {
        $this->requireParameterCount(1, $parameters, 'before_or_equal');

        return $this->compareDates($attribute, $value, $parameters, '<=');
    }
394359
protected function validateSize($attribute, $value, $parameters)
    {
        $this->requireParameterCount(1, $parameters, 'size');

        return $this->getSize($attribute, $value) == $parameters[0];
    }
1300924
protected function _validate_timestamp($value, $parameters)
    {
        $timestamp = is_numeric($value) ? (int)$value : strtotime($value);
        if ($timestamp === false) {
            return null;
        }

        if (isset($parameters[0])) {
            if ($parameters[0] === 'start') {
                /** @noinspection SummerTimeUnsafeTimeManipulationInspection */
                return (int)($timestamp / 86400) * 86400;
            } elseif ($parameters[0] === 'end') {
                /** @noinspection SummerTimeUnsafeTimeManipulationInspection */
                return (int)($timestamp / 86400) * 86400 + 86399;
            } else {
                return strtotime(date($parameters[0], $timestamp));
            }
        }

        return $timestamp;
    }
774198
public function validateEmptyWith($attribute, $value, $parameters)
    {
        $values = [];

        foreach ($parameters as $parameter) {
            $values[] = $this->getValue($parameter);
        }

        return Validator::isEmptyWith($value, $values);
    }
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);
    }
910524
protected function validateRegex($attribute, $value, $parameters)
    {
        $this->requireParameterCount(1, $parameters, 'regex');

        return preg_match($parameters[0], $value);
    }
696242
public function validateDateEquals($attribute, $value, $parameters)
    {
        $this->requireParameterCount(1, $parameters, 'date_equals');

        return $this->compareDates($attribute, $value, $parameters, '=');
    }
695137
protected function validateDistinct( $attribute, $value, $parameters )
	{
		$attributeName = $this->getPrimaryAttribute( $attribute );

		$explicitPath = $this->getLeadingExplicitAttributePath( $attributeName );

		$attributeData = $this->extractDataFromPath( $explicitPath );

		$data = Arr::where( Arr::dot( $attributeData ), function ( $key ) use ( $attribute, $attributeName )
		{
			return $key != $attribute && Str::is( $attributeName, $key );
		} );

		return !in_array( $value, array_values( $data ) );
	}
1238146
protected function validateRequiredWith($attribute, $value, $parameters)
    {
        if (! $this->allFailingRequired($parameters)) {
            return $this->validateRequired($attribute, $value);
        }

        return true;
    }
666557
public function validateAfterOrEqual($attribute, $value, $parameters)
    {
        $this->requireParameterCount(1, $parameters, 'after_or_equal');

        return $this->compareDates($attribute, $value, $parameters, '>=');
    }
374737
public function validateHoneytime($attribute, $value, $parameters)
    {
        if ($this->disabled) {
            return true;
        }
        
        // Get the decrypted time
        $value = $this->decryptTime($value);

        // The current time should be greater than the time the form was built + the speed option
        return ( is_numeric($value) && time() > ($value + $parameters[0]) );
    }
532612
public function validateMimes($attribute, $value, $parameters)
    {
        if (! $this->isValidFileInstance($value)) {
            return false;
        }

        if ($this->shouldBlockPhpUpload($value, $parameters)) {
            return false;
        }

        return $value->getPath() !== '' && in_array($value->guessExtension(), $parameters);
    }
866607
protected function validateAfterWithFormat($format, $value, $parameters)
    {
        $param = $this->getValue($parameters[0]) ?: $parameters[0];

        return $this->checkDateTimeOrder($format, $param, $value);
    }
97607
public function isDateFormat($value, $parameters)
    {
        $this->requireParameterCount(1, $parameters, 'date_format');

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

        $date = DateTime::createFromFormat($parameters[0], $value);

        return $date && $date->format($parameters[0]) == $value;
    }
1343485
public function validateMimetypes($attribute, $value, $parameters)
    {
        if (! $this->isValidFileInstance($value)) {
            return false;
        }

        if ($this->shouldBlockPhpUpload($value, $parameters)) {
            return false;
        }

        return $value->getPath() !== '' &&
                (in_array($value->getMimeType(), $parameters) ||
                 in_array(explode('/', $value->getMimeType())[0].'/*', $parameters));
    }
1188785
public function validateUniqueWith($attribute, $value, $parameters) {
        // cleaning: trim whitespace
        $parameters = array_map('trim', $parameters);

        // first item equals table name
        $table = array_shift($parameters);

        // 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 = $attribute;

        // Create $extra array with all other columns, so getCount() will
        // include them as where clauses as well
        $extra = array();

        // Check if last parameter is an integer. If it is, then it will
        // ignore the row with the specified id - useful when updating a row
        list($ignore_id, $ignore_column) = $this->getIgnore($parameters);

        // Figure out whether field_name is the same as column_name
        // or column_name is explicitly specified.
        //
        // case 1:
        //     $parameter = 'last_name'
        //     => field_name = column_name = 'last_name'
        // case 2:
        //     $parameter = 'last_name=sur_name'
        //     => field_name = 'last_name', column_name = 'sur_name'
        foreach ($parameters as $parameter) {
            $parameter = array_map('trim', explode('=', $parameter, 2));
            $field_name = $parameter[0];

            if (count($parameter) > 1) {
                $column_name = $parameter[1];
            } else {
                $column_name = $field_name;
            }

            // Figure out whether main field_name has an explicitly specified
            // column_name
            if ($field_name == $column) {
                $column = $column_name;
            } else {
                $extra[$column_name] = array_get($this->data, $field_name);
            }
        }

        // 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->getPresenceVerifier();

        return $verifier->getCount(
                        $table, $column, $value, $ignore_id, $ignore_column, $extra
                ) == 0;
    }
202078
protected function validateUnique( $attribute, $value, $parameters )
	{
		$this->requireParameterCount( 1, $parameters, 'unique' );

		list( $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 = isset( $parameters[1] ) ? $parameters[1] : $this->guessColumnForQuery( $attribute );

		list( $idColumn, $id ) = [null, null];

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

			if ( preg_match( '/\[(.*)\]/', $id, $matches ) )
			{
				$id = $this->getValue( $matches[1] );
			}

			if ( strtolower( $id ) == 'null' )
			{
				$id = null;
			}

			if ( filter_var( $id, FILTER_VALIDATE_INT ) !== false )
			{
				$id = intval( $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->getPresenceVerifier();

		$verifier->setConnection( $connection );

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

		return $verifier->getCount( $table, $column, $value, $id, $idColumn, $extra

		) == 0;
	}