title: Laravel 5.6 Date of Birth Validation
body: <p>I created validation rules in my Member Model with date of birth NOT being required. However, when someone does fill in their date of birth, I want it to be 
  1. in the correct format and 
  2. the date cannot be a date in the future.</p>
  
  <p>However, when I fill out my form and leave date of birth empty, I still get the following error:</p>
  
  <p><a href="https://i.stack.imgur.com/E7Bms.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/E7Bms.png" alt="enter image description here"></a></p>
  
  <p>Here my basic Member.php model:</p>
  
  <pre><code>use Esensi\Model\Model;
  
  class Member extends Model
  {
      protected $rules = [
          'name' =&gt; 'required|alpha|min:2|max:255',
          'surname' =&gt; 'required|alpha|min:2|max:255',
          'id_number' =&gt; 'required|unique:members,id_number|digits:13',
          'mobile_number' =&gt; 'required|digits:10',
          'email' =&gt; 'required|email',
          'date_of_birth' =&gt; 'date_format:Y-M-D|before:today',
      ];
  }
  </code></pre>
  
  <p>Here's my MemberController.php store function:</p>
  
  <pre><code>public function store(Request $request) 
  {
      $member = new Member;
      $member-&gt;name = $request-&gt;name;
      $member-&gt;surname = $request-&gt;surname;
      $member-&gt;id_number = $request-&gt;id_number;
      $member-&gt;mobile_number = $request-&gt;mobile_number;
      $member-&gt;email = $request-&gt;email;
      $member-&gt;date_of_birth = $request-&gt;date_of_birth;
  
      if(!$member-&gt;save()){
          $errors = $member-&gt;getErrors();
  
           return redirect()
              -&gt;action('MemberController@create')
              -&gt;with('errors', $errors)
              -&gt;withInput();
  }
  //successful creation
      return redirect()
          -&gt;action('MemberController@index')
          -&gt;with('message', '&lt;div class="alert alert-success"&gt;Member Created Successfully!&lt;/div&gt;');
  
  }
  </code></pre>
  
  <p>How do I fix it so that date of birth only shows an error when the field is actually filled in but the formatting is incorrect?</p>