I am sending data request in this format to my laravel backend application
array:2 [
0 => array:2 [
"email" => "[email protected]"
"role_id" => 2
]
1 => array:2 [
"email" => "[email protected]"
"role_id" => 3
]
]
How do I validate the email and role_id in laravel
If your validation is generated using
php artisan make:requestuse therulesmethod.The same validation rules can be applied within the controller
validatemethod.