title: How to insert date format YY-MM into database?
body: <p>I have been trying to get the the Year and Month from the user and insert them into the database. 
  i am using input type month so that the user can send only the Year and the Month.</p>
  
  <pre><code>&lt;input type="month" name="date_from"/&gt;
  &lt;input type="month" name="date_to"/&gt;
  </code></pre>
  
  <p>and this is my model</p>
  
  <pre><code>function setDateFromAttribute($value)
  {
      $this-&gt;attributes['date_from'] = \Carbon\Carbon::createDateFromFormat('Y-m', $value);
  }
  
  
  function setDateToAttribute($value)
  {
      $this-&gt;attributes['date_to'] = \Carbon\Carbon::createDateToFormat('Y-m', $value);
  }
  
  
  protected $fillable = [
      'date_from',
      'date_to',
  ];
  </code></pre>
  
  <p>and data is saved as 0000.00.00
  the data type in my database for these two inputs is </p>
  
  <pre><code>timestamp
  </code></pre>
  
  <p>i do not know what i am doing wrong here. please help</p>