Commit af5e4c6b authored by Taylor Otwell's avatar Taylor Otwell

Merge pull request #278 from codler/patch-8

Validate IP
parents 1fc86102 5974a58b
......@@ -434,6 +434,18 @@ class Validator {
return $query->count() == 0;
}
/**
* Validate that an attribute is a valid IP.
*
* @param string $attribute
* @param mixed $value
* @return bool
*/
protected function validate_ip($attribute, $value)
{
return filter_var($value, FILTER_VALIDATE_IP) !== false;
}
/**
* Validate that an attribute is a valid e-mail address.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment