title: Using bootstrap-datepicker in laravel
body: <p>I am getting errors on submitting a form to the server that has a bootstrap-datepicker field. What should I do now?</p>
  
  <p>The error report is: </p>
  
  <pre><code>InvalidArgumentException in Carbon.php line 425:
  Unexpected data found.
  Unexpected data found.
  Data missing
  </code></pre>
  
  <p>in database migration file:</p>
  
  <pre><code>$table-&gt;timestamp('dob'); // dob is date of birth
  </code></pre>
  
  <p>in my model: </p>
  
  <pre><code>protected $dates = ['dob'];
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div class="form-group {{ $errors-&gt;has('dob') ? 'has-error' : '' }}"&gt;
     &lt;label class="col-sm-2 control-label"&gt;Birthday*&lt;/label&gt;
       &lt;div class="col-sm-10"&gt;
          &lt;input type="text" class="form-control" name="dob" required="" id="datepicker" value="{{ old("dob") }}"&gt;
          {!! $errors-&gt;first('dob','&lt;span class="help-block"&gt;:message&lt;/span&gt;') !!}
        &lt;/div&gt;
   &lt;/div&gt;
  </code></pre>
  
  <p>script:</p>
  
  <pre><code>&lt;script src="{{ url('js/bootstrap-datepicker.js') }}" charset="utf-8"&gt;&lt;/script&gt;
  &lt;script&gt;
  $('#datepicker').datepicker({
       autoclose: true
     });
  &lt;/script&gt;
  </code></pre>