Skip to content

Commit

Permalink
Merge pull request #3 from luismabenitez/2.x
Browse files Browse the repository at this point in the history
added the prepareForValidation() into the requests. Commented by default
  • Loading branch information
Mahmoud-Italy authored Aug 27, 2020
2 parents 0d1027f + 06d515b commit 2b1ed55
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions resources/stubs/request.stub
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,20 @@ class DummyClass extends FormRequest
return true;
}

/**
* Prepare the data for validation if the data comes in json format
*
* @return void
*/
/*
protected function prepareForValidation()
{
collect(json_decode($this->data, true))->each(function ($row, $key) {
$this->merge([$key => $row]);
});
}
*/

/**
* Get the validation rules that apply to the request.
*
Expand Down

0 comments on commit 2b1ed55

Please sign in to comment.