Validate text field with required_if for date value
How i can validate the text field with required_if for date value is after_or_equal ??
backups.*.backupName' => 'nullable|required_if:date_from,after_or_equal:today|
I tried above, but not working.
You can apply the dates on the date itself, and not on the backupName as I guess the date for the backup cannot be an old value neither, right?
So just:
'date_from' => 'nullable|date|after_or_equal:today'
'backups.*.backupName' => 'nullable|required_with:date_from|
No.
date_from can be old date, but i want backupName is required only if date_from is today or greater.
I think i need to wite a custom validation.
For now i have put the valodation with condition as:
if($date_from > new DateTime()){ do validation }
Please or to participate in this conversation.