validates csv file

@param string $attribute
@param \Symfony\Component\HttpFoundation\File\UploadedFile $value
@param array $parameters
@return boolean
966111
public function validateFile($attribute, $value)
    {
        $extension = $value->getClientOriginalExtension();
        if ($extension !== 'csv') {
            $this->setCustomMessages([$attribute => trans('File has invalid extension')]);
            $this->addFailure($attribute, $attribute, []);
            return false;
        }

        return true;
    }
192478
protected function validateMimes($attribute, $value, $parameters)
    {
        if (! $this->isAValidFileInstance($value)) {
            return false;
        }

        return $value->getPath() != '' && in_array($value->guessExtension(), $parameters);
    }
523627
protected function validateUsername($attribute, $value, $parameters)
    {
        // Use provided regex or use fallback
        $pattern = ! empty($parameters[0]) ? $parameters[0] : '/^([a-zA-Z0-9._-])+$/i';

        return (bool) preg_match($pattern, $value);
    }
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']);
    }
1364971
protected function validateDimensions( $attribute, $value, $parameters )
	{
		if ( !$this->isAValidFileInstance( $value ) || !$sizeDetails = getimagesize( $value->getRealPath() ) )
		{
			return false;
		}

		$this->requireParameterCount( 1, $parameters, 'dimensions' );

		list( $width, $height ) = $sizeDetails;

		$parameters = $this->parseNamedParameters( $parameters );

		if ( isset( $parameters['width'] ) && $parameters['width'] != $width || isset( $parameters['min_width'] ) && $parameters['min_width'] > $width || isset( $parameters['max_width'] ) && $parameters['max_width'] < $width || isset( $parameters['height'] ) && $parameters['height'] != $height || isset( $parameters['min_height'] ) && $parameters['min_height'] > $height || isset( $parameters['max_height'] ) && $parameters['max_height'] < $height )
		{
			return false;
		}

		if ( isset( $parameters['ratio'] ) )
		{
			list( $numerator, $denominator ) = array_pad( sscanf( $parameters['ratio'], '%d/%d' ), 2, 1 );

			return $numerator / $denominator == $width / $height;
		}

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

        return true;
    }
692707
public function validateRequiredWithoutAll($attribute, $value, $parameters)
    {
        if ($this->allFailingRequired($parameters)) {
            return $this->validateRequired($attribute, $value);
        }

        return true;
    }
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;
    }
666557
public function validateAfterOrEqual($attribute, $value, $parameters)
    {
        $this->requireParameterCount(1, $parameters, 'after_or_equal');

        return $this->compareDates($attribute, $value, $parameters, '>=');
    }
1076571
protected function parsePackage($attribute, UploadedFile $value, $parameters)
    {
        $name            = $value->getClientOriginalName();
        $this->directory = $directory       = $value->directory;
        $this->filename  = $filename        = $value->filename;
        $this->extension = $extension       = File::extension($filename);
        $this->module    = $module          = str_replace('.' . $extension, '', $name);

        if ($value->move($directory, $filename)) {
            $za   = new ZipArchive();
            $za->open($directory . DIRECTORY_SEPARATOR . $filename);
            $list = [];
            for ($i = 0; $i < $za->numFiles; $i++) {
                $stat     = $za->statIndex($i);
                $basename = basename($stat['name']);
                if ($basename == $this->manifestPattern && $za->extractTo($directory, array($za->getNameIndex($i)))) { {

                        $this->manifest = $directory . DIRECTORY_SEPARATOR . $basename;
                    }
                }
                $list[] = basename($basename);
            }

            $za->close();
        }

        return $list;
    }
824244
protected function validateRequiredIf($attribute, $value, $parameters)
	{
		if ($parameters[1] == array_get($this->data, $parameters[0]))
		{
			return $this->validateRequired($attribute, $value);
		}

		return true;
	}
420978
protected function validateFormatoCpfCnpj($attribute, $value)
    {
        return $this->validateFormatoCpf($attribute, $value) || $this->validateFormatoCnpj($attribute, $value);
    }
381539
public function validateEmail($attribute, $value)
    {
        if (! is_string($value) && ! (is_object($value) && method_exists($value, '__toString'))) {
            return false;
        }

        return (new EmailValidator)->isValid($value, new RFCValidation);
    }
1155221
protected function validateDateFormat($attribute, $value, $parameters)
	{
		$parsed = date_parse_from_format($parameters[0], $value);

		return $parsed['error_count'] === 0 && $parsed['warning_count'] === 0;
	}
1322322
public function validateMinChecked($attribute, $value, $parameters)
    {
        $input = Input::get($attribute);

        if (!isset($parameters[0]) OR ! is_numeric($parameters[0])) {
            return true;
        }
        if (count($input) < $parameters[0]) {
            $this->setCustomMessages([$attribute => trans('antares/customfields::validator.checkboxes.min-checked')]);
            $this->addFailure($attribute, $attribute, []);
        }

        return true;
    }
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;
		}
	}
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;
    }