I want to add a precision of my User's created_at column. So I created another migration file to update the attribute of created_at but it doesn't work.
Here's my migration file
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->dateTime('created_at', 3)->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('created_at');
});
}
There's no error when I run the php artisan migrate. But whenever I try to create a new User it doesn't reflect changes.
I also added the date format in my User model
protected $dateFormat = 'Y-m-d H:i:s.v';