Commit cbf2399a authored by Taylor Otwell's avatar Taylor Otwell

Default Validator target to Input data.

parent 21f33bb4
......@@ -29,10 +29,15 @@ class Validator {
* @param mixed $target
* @return void
*/
public function __construct($target = array())
public function __construct($target = null)
{
$this->errors = new Validation\Error_Collector;
if (is_null($target))
{
$target = Input::get();
}
// ---------------------------------------------------------
// If the source is an Eloquent model, use the model's
// attributes as the validation attributes.
......@@ -46,7 +51,7 @@ class Validator {
* @param mixed $target
* @return Validator
*/
public static function make($target = array())
public static function make($target = null)
{
return new static($target);
}
......
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