I need to extend laravel validator creating a new validator but the problem is that I need to pass 2 parameters, one for days
and one for slots
. How to solve this?
Example dd($request->all)
dump:
array:2 [
"days" => array:2 [
0 => "1" // Mon
1 => "2" // Tue
]
"slots" => array:2 [
1 => array:2 [
"open" => "09:00"
"close" => "11:30"
]
2 => array:2 [
"open" => "16:00"
"close" => "21:00"
]
]
]
It need to loop through days
and check with slots
.
Pseudo code, example:
foreach($days as $day) {
foreach($slots as $slot)
{
// Validation Logic for $day and $slot (open and close)
}
}