I have array type field like
foreach ($row as $data) {
}
Now in my controller i want to validate these field (i.e. required or not) based on condition.
Controller :
foreach($req)...
if(somevalue)
{
$rules[$fieldname['name']] = 'required';
}
}
Here the issue is i have common name for the field, so i will i specify the name that is to be validated in the rules array.
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3hVJJsO
via IFTTT
Aucun commentaire:
Enregistrer un commentaire