Browse Source

added passes and fails method to validtor.

Taylor Otwell 13 years ago
parent
commit
e1c8928550
1 changed files with 20 additions and 0 deletions
  1. 20 0
      laravel/validator.php

+ 20 - 0
laravel/validator.php

@@ -117,6 +117,26 @@ class Validator {
 		static::$validators[$name] = $validator;
 	}
 
+	/**
+	 * Validate the target array using the specified validation rules.
+	 *
+	 * @return bool
+	 */
+	public function passes()
+	{
+		return $this->valid();
+	}
+
+	/**
+	 * Validate the target array using the specified validation rules.
+	 *
+	 * @return bool
+	 */
+	public function fails()
+	{
+		return $this->invalid();
+	}
+
 	/**
 	 * Validate the target array using the specified validation rules.
 	 *