Is it possible to expand validator responses from nested arrays. Typically Laravel responds with the "dot notation" for example:
[
'organisation.name' => 'required|max:60|min:3',
'organisation.avatar' => '',
'organisation.phone' => 'required|max:25|min:5',
'organisation.paid_staff' => 'required|numeric'
]
An error with organisation.name wold return:
{
"message": "422 Unprocessable Entity",
"errors": {
"organisation.name": [
"The organisation name has already been taken."
]
},
"statusCode": 422
};
Where i would like to have the dot notation expanded as such:
{
"message": "422 Unprocessable Entity",
"errors": {
"organisation": {
"name": [
"The organisation name has already been taken."
]
}
},
"statusCode": 422
};
Can anyone shed light on this?