Set the model
$timestamps
property tofalse
.Eloquent will always automatically manage
created_at
andupdated_at
columns.Set the model
$created_at
andupdated_at
properties tofalse
.
I searched the net and found a lot of solution and what must be the real answer to this question,
I found that we can disable it add a line into the eloquent to make timestamp false
class User extends Eloquent { protected $table = 'users'; public $timestamps = false; }
But we can also remove the created_at
and updated_at
and do not use it in the model so 3rd point is also true here?
So what is the proper solution for this question?
Advertisement
Answer
you should set the $timestamps
property to false
in your model. and not add the timestamp columns ($table->timestamps();
) in your table migration.