i am passing json data into validation in laravel using form request the data format is as following :
array (
'editProfileForm' =>
array (
'username' => 'test',
'email' => '[email protected]',
'phone' => '11112332',
)
form request
'editProfileForm.*.username' => 'numeric',
'editProfileForm.*.email'=> 'email|unique:users',
'editProfileForm.*.phone' => 'numeric|unique:users',
actually the json data is not being accessed in order to be validatetd how can i access the json array under editProfileForm ?
CodePudding user response:
You should validate editProfileForm
as a object, not array
'editProfileForm.username' => 'numeric',
'editProfileForm.email'=> 'email|unique:users',
'editProfileForm.phone' => 'numeric|unique:users',