title: How to handle unset/default dates in Laravel? (with Carbon)
body: <p>Laravel automatically passes the <code>created_at</code> and the <code>updated_at</code> (from an Eloquent model) into a new Carbon instance, as per the documentation. </p>
  
  <p>It seems though, that if the value is the default <code>0000-00-00 00:00:00</code> it outputs the following:
  <code>-0001-11-30 06:12:32</code> for all <code>0000-00-00 00:00:00</code> values. </p>
  
  <p>The fields are set to timestamp type. </p>
  
  <p>I'm using the following at the moment (within the model), but it feels clumsy to have to do this across all Laravel models that may contain a default/unset date.</p>
  
  <pre><code>public function getCreatedAtAttribute($value) {
      return $value == "0000-00-00 00:00:00" ? "0000-00-00 00:00:00" : $value;
  }
  </code></pre>