I'm pulling data from an API - the created_at and updated_at fields are of the format.
'created_at' => '2015-07-28T23:10:30Z', 'updated_at' => '2015-07-29T00:22:06Z'
I'm trying to push the data into my database but am getting the following error:
InvalidArgumentException in Carbon.php line 414:
Unexpected data found.
Trailing data
I'm thinking I need a date Mutator on my migration but not sure how to go about that for pushing the data to the database. my migration looks like this.
public function up()
{
Schema::create('commits', function (Blueprint $table) {
$table->increments('id');
$table->text('number');
$table->string('userName');
$table->string('title');
$table->text('body');
$table->string('sha')->unique();
$table->dateTime('created_at');
$table->dateTime('updated_at');
});
}
What do I need to do for Carbon to recognize my format? Or am I making the wrong assumtion?