Solution:
If you’re not using the created_at
or updated_at
fields, you need to set the $timestamps
property on your model to false. Additionally, you don’t need to override the setUpdatedAt()
or setCreatedAt()
methods.
class Category extends Model
{
protected $fillable = ['name', 'mm_name'];
public $timestamps = false;
}
If $timestamps
is true, the Eloquent query builder will add in the updated_at
field whenever you update a model.