Default Validator target to Input data.
This commit is contained in:
parent
21f33bb46d
commit
cbf2399ab8
|
@ -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 @@ public function __construct($target = array())
|
|||
* @param mixed $target
|
||||
* @return Validator
|
||||
*/
|
||||
public static function make($target = array())
|
||||
public static function make($target = null)
|
||||
{
|
||||
return new static($target);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue