Skip to content

Commit

Permalink
Fix duplicate validation issue (#26604)
Browse files Browse the repository at this point in the history
This will prevent validation from happening twice. Fixes laravel/framework#25736
  • Loading branch information
driesvints authored and taylorotwell committed Nov 23, 2018
1 parent 6a75b7f commit a3b167e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,22 @@ public function validate()
throw new ValidationException($this);
}

return $this->validated();
}

/**
* Return validated value.
*
* @return array
*
* @throws \Illuminate\Validation\ValidationException
*/
public function validated()
{
if ($this->invalid()) {
throw new ValidationException($this);
}

$results = [];

$missingValue = Str::random(10);
Expand Down

0 comments on commit a3b167e

Please sign in to comment.