Form requests depend on the validator validated function to only return data that is validated and specified in the rules.
Rules
return [
'items' => [
'array'
],
'items.id' => [
'string'
]
];
Input data:
{
"items" : {
"id" : "a",
"name" : "Twee"
}
}
Returned validated data:
Result of : $request->validated();
(
[items] => Array
(
[id] => a
[name] => Twee
)
)
Expected:
(
[items] => Array
(
[id] => a
)
)
Adding an extra check in the Validator file to ensure no arrays are added back as a whole fixes the issue.
Hi there,
Thanks for reporting but it looks like this is a question which can be asked on a support channel. Please only use this issue tracker for reporting bugs with the library itself. If you have a question on how to use functionality provided by this repo you can try one of the following channels:
However, this issue will not be locked and everyone is still free to discuss solutions to your problem!
Thanks.
@driesvints this is not a question? This is a bug?
Feel free to attempt that PR again but with a proper explanation and tests (see the PR template).
Why is this even closed?
Most helpful comment
Why is this even closed?