title: Format date string in carbon in laravel5?
body: <p>I want to convert <code>$date='01-07-2010'</code> in to <code>2010-07-01</code></p>
  
  <p>My following code is not wokring,</p>
  
  <pre><code>Carbon::createFromFormat('Y-m-d', $date);
  </code></pre>
  
  <p>It throws error,</p>
  
  <pre><code>InvalidArgumentException in Carbon.php line 414: Trailing data
  </code></pre>
  
  <p>How can I solve this?</p>