title: Laravel Livewire bind model Carbon attribute
body: <p>I'm using Laravel Livewire v2 and I need to bind a form date input to a model Carbon attribute in the backend Livewire component, but it seems to be impossible due date formatting.</p>
  <p>To be more precise:</p>
  <ul>
  <li>when selecting a date the form date input picker livewire make a api call sending the correct date (e.g.: <code>2020-02-02</code>)</li>
  <li>the Livewire component correctly receive and pass the string value to the model</li>
  <li>the model cast the string to a Carbon object and assign it to its fillable attribute</li>
  <li>the Livewire component try to send back to the client the data but it doesn't perform a <code>-&gt;format('Y-m-d')</code> format on the Carbon object, so a serialized date object is sent</li>
  <li>when object is unserialized fronted receive e.g. <code>2012-12-25T20:30:00.000000+04:00 MSK</code></li>
  <li>the date input break</li>
  </ul>
  <p>I also found that in Livewire v1 it was possible to cast properties (<a href="https://laravel-livewire.com/docs/1.x/properties#casting-properties" rel="nofollow noreferrer">link</a>) using key-value array or custom casting methods, but this has been removed in v2 (<a href="https://laravel-livewire.com/docs/2.x/upgrading#casters" rel="nofollow noreferrer">link</a>); there is an example with <code>hydrate</code>/<code>dehydrate</code> methods to achieve the same effect but the example cover the case of a component property, not a nested one as in my case.</p>
  <p>Is there a way to cast a model date prop or to add a format when sending data back to client?</p>