Check if a form field exists when doing form validation? Laravel 5 -
i have form has conditional logic displays or hides each field. want validate fields shown. see field list in validation script below , imagine hide "phone" form field in using conditional logic in view — still want validate rest of fields, if "phone" validation still there, script fails , shows error message saying "the phone number required." in laravel 5, there way check if form field exists or change whether it's required or not dynamically before or when validating form? here's validation code... $v = validator::make(input()->all(), [ 'firstname' => 'required|min:1|max:80', 'lastname' => 'required|min:1|max:80', 'address' => 'required|min:10|max:80', 'address2' => 'max:20', 'city' => 'required|min:2|max:80', 'state' => 'required|min:2|max:...