-
Notifications
You must be signed in to change notification settings - Fork 11.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[5.6] withTimestamps() never applied to custom pivot model #23601
Comments
I've had the same issue. Apparently the custom pivot is created using |
It took me ages to find out but came to the same conclusion (before finding this issue): |
Description:
When calling
->withTimestamps()
on a belongs to many relation it is never applied to a custom pivot model registered with->using()
.Steps To Reproduce:
Create a model for example
Domains
that belongs to many toCertificates
using the following relation method:The pivot model was reduced to the bare minimum to rule out a user error:
Observe that when updating the pivot model via the
updated_at
will not be updated:When confirming the
timestamps
attribute on the model istrue
we see it's not:When defining the relationship like this:
The
updated_at
column will be updated when the pivot model is saved.The text was updated successfully, but these errors were encountered: