Validate the MIME type of a file upload attribute is in a set of MIME types.

@param  string  $attribute
@param  mixed  $value
@param  array   $parameters
@return bool
192478
protected function validateMimes($attribute, $value, $parameters)
    {
        if (! $this->isAValidFileInstance($value)) {
            return false;
        }

        return $value->getPath() != '' && in_array($value->guessExtension(), $parameters);
    }
74317
protected function validateString( $attribute, $value )
	{
		if ( !$this->hasAttribute( $attribute ) )
		{
			return true;
		}

		return is_null( $value ) || is_string( $value );
	}
582578
protected function validateAfter($attribute, $value, $parameters)
	{
		if ( ! ($date = strtotime($parameters[0])))
		{
			return strtotime($value) > strtotime($this->getValue($parameters[0]));
		}
		else
		{
			return strtotime($value) > $date;
		}
	}
373569
public function validateValidatorList($attribute, $value, $parameters)
    {
        $validators = Input::get('validators');
        if (!is_null($validators)) {
            foreach ($validators as $index => $id) {
                if (isset($value[$id]) && $value[$id] == '') {
                    $this->setCustomMessages(["validator_custom[{$id}]" => trans('antares/customfields::validator.create.validators-empty-fields')]);
                    $this->addFailure("validator_custom[{$id}]", "validator_custom[{$id}]", []);
                    break;
                }
            }
        }

        return true;
    }
1133050
protected function validateDate($attribute, $value)
    {
        if ($value instanceof DateTime) {
            return true;
        }

        if (strtotime($value) === false) {
            return false;
        }

        $date = date_parse($value);

        return checkdate($date['month'], $date['day'], $date['year']);
    }
1038287
public function validateImageAspect($attribute, $value, $parameters)
    {
        $image = $this->getImagePath($value);

        // Get the image dimension info, or fail.

        $image_size = @getimagesize($image);
        if ($image_size === false) {
            return false;
        }

        $image_width = $image_size[0];
        $image_height = $image_size[1];

        // Parse the parameter(s).  Options are:
        //
        // 	"0.75"   - one param: a decimal ratio (width/height)
        // 	"3,4"    - two params: width, height
        //
        // If the first value is prefixed with "~", the orientation doesn't matter, i.e.:
        //
        // 	"~3,4"   - would accept either "3:4" or "4:3" images

        $both_orientations = false;

        if (substr($parameters[0], 0, 1) === '~') {
            $parameters[0] = substr($parameters[0], 1);
            $both_orientations = true;
        }

        if (count($parameters) === 1) {
            $aspect_width = $parameters[0];
            $aspect_height = 1;
        } else {
            $aspect_width = (int) $parameters[0];
            $aspect_height = (int) $parameters[1];
        }

        if ($aspect_width === 0 || $aspect_height === 0) {
            throw new RuntimeException('Aspect is zero or infinite: ' . $parameters[0]);
        }

        $check = ($image_width * $aspect_height) / $aspect_width;

        if ((int) round($check) === $image_height) {
            return true;
        }

        if ($both_orientations) {
            $check = ($image_width * $aspect_width) / $aspect_height;
            if ((int) round($check) === $image_height) {
                return true;
            }
        }

        return false;
    }
144836
protected function validateDigits($attribute, $value, $parameters)
    {
        $this->requireParameterCount(1, $parameters, 'digits');

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

        return true;
    }
874925
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;
        }
    }
228305
public function validateDigitsBetween($attribute, $value, $parameters)
    {
        $this->requireParameterCount(2, $parameters, 'digits_between');

        $length = strlen((string) $value);

        return ! preg_match('/[^0-9]/', $value)
                    && $length >= $parameters[0] && $length <= $parameters[1];
    }
152990
protected function compareDates($attribute, $value, $parameters, $operator)
    {
        if (! is_string($value) && ! is_numeric($value) && ! $value instanceof DateTimeInterface) {
            return false;
        }

        if ($format = $this->getDateFormat($attribute)) {
            return $this->checkDateTimeOrder($format, $value, $parameters[0], $operator);
        }

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

        return $this->compare($this->getDateTimestamp($value), $date, $operator);
    }
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;
    }
9843
protected function validateDateFormat($attribute, $value, $parameters)
    {
        $this->requireParameterCount(1, $parameters, 'date_format');

        $parsed = date_parse_from_format($parameters[0], $value);

        return $parsed['error_count'] === 0 && $parsed['warning_count'] === 0;
    }
366346
protected function validateFilled($attribute, $value)
    {
        if (array_key_exists($attribute, $this->data) || array_key_exists($attribute, $this->files)) {
            return $this->validateRequired($attribute, $value);
        }

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

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

        return Validator::isEmptyWith($value, $values);
    }
394359
protected function validateSize($attribute, $value, $parameters)
    {
        $this->requireParameterCount(1, $parameters, 'size');

        return $this->getSize($attribute, $value) == $parameters[0];
    }
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;
    }