title: Check if a form field exists when doing form validation? Laravel 5
body: <p>I have a form that has some conditional logic that displays or hides each field. I only want to validate the fields that are shown. See the field list in my validation script below and imagine I hide the "phone" form field in using conditional logic in the view — I still want to validate the rest of the fields, but if "phone" validation is still there, the script fails and shows the error message saying "The phone number is required."</p>
  
  <p>In Laravel 5, is there a way check if a form field exists or change whether it's required or not dynamically before or when validating the form?</p>
  
  <p>Here's my validation code...</p>
  
  <pre><code>        $v = Validator::make(input()-&gt;all(), [
              'firstName' =&gt; 'required|Min:1|Max:80',
              'lastName'  =&gt; 'required|Min:1|Max:80',
              'address'  =&gt; 'required|Min:10|Max:80',
              'address2'  =&gt; 'Max:20',
              'city'  =&gt; 'required|Min:2|Max:80',
              'state'  =&gt; 'required|Min:2|Max:80',
              'zip'  =&gt; 'required|Min:5',
              'phone'  =&gt; 'required|regex:'.validPhoneRegex(),
          ]);
          if($v-&gt;fails())
          {
              return redirect()-&gt;back()-&gt;withErrors($v)-&gt;withInput(input()-&gt;all());
          }
  </code></pre>