Skip to content

Commit

Permalink
Using prepareForValidation method instead of validationData for sanitize
Browse files Browse the repository at this point in the history
  • Loading branch information
arcanedev-maroc committed Dec 28, 2016
1 parent 6bfd2c4 commit 9cb4001
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/Bases/FormRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,15 @@ public function authorize()
abstract public function rules();

/**
* Get data to be validated from the request.
*
* @return array
* Prepare the data for validation.
*/
protected function validationData()
protected function prepareForValidation()
{
if (method_exists($this, 'sanitize')) {
$this->merge(
$this->container->call([$this, 'sanitize'])
);
}

return $this->all();
}

/**
Expand Down

0 comments on commit 9cb4001

Please sign in to comment.