I make a post request to the Laravel server from the Vue.js server. How I can validate complex array in request on the server-side.
Here is my request payload:
{
"insurance": [
"Blue Cross Blue Shield",
"United Behavioral Health",
"Aetna Behavioral Health",
"Tricare East","Medicare","Humana"
],
"caqh": {
"username":"myusername",
"password":"my password"
},
"nppes": {
"username":"new username",
"password":"passowrd"
}
}
I want to validate all the fields via $request->validate([ 'username'=>'required' ]) How would I achieve this?