From 06d515b486dbd258ccafa52c80ba46290155ff04 Mon Sep 17 00:00:00 2001 From: Luisma Date: Wed, 26 Aug 2020 11:40:41 +0200 Subject: [PATCH] added the prepareForValidation() into the requests. Commented by default --- resources/stubs/request.stub | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/resources/stubs/request.stub b/resources/stubs/request.stub index c6b7045..1f18e74 100755 --- a/resources/stubs/request.stub +++ b/resources/stubs/request.stub @@ -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. *