You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my system I have tables with an created_at column but no updated_at column so I created my models with $timestamps = true and UPDATED_AT = null.
It works when I do direct action on the model but when I try to do a bulk update by a relation the relation try to set an empty column to the current time.
For me it's a bug in IlluminateDatabaseEloquentRelationsHasOneOrMany::update, it add the updated_at attribute even if it's null.
Steps To Reproduce:
Create a model with UPDATED_AT = null
Use this model in an hasMany relation
Try to update the related model by the relation
class Bug extends Eloquent
{
constUPDATED_AT = null;
}
class Foo extends Eloquent
{
publicfunctionbugs()
{
return$this->hasMany(Bug::class);
}
}
$foo = // An instance of Foo$foo->bugs()->update([
'test' => 'bar',
]);
The text was updated successfully, but these errors were encountered:
Description:
In my system I have tables with an created_at column but no updated_at column so I created my models with $timestamps = true and UPDATED_AT = null.
It works when I do direct action on the model but when I try to do a bulk update by a relation the relation try to set an empty column to the current time.
For me it's a bug in IlluminateDatabaseEloquentRelationsHasOneOrMany::update, it add the updated_at attribute even if it's null.
Steps To Reproduce:
The text was updated successfully, but these errors were encountered: