Skip to content
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

[11.x] Fix determining pivot timestamp column name(s) when parent relation missing one or both of timestamps #53103

Merged
merged 1 commit into from
Oct 10, 2024

Conversation

daniser
Copy link
Contributor

@daniser daniser commented Oct 10, 2024

Currently timestamped pivots try to determine its timestamp column names from its parent relation. But parent model can have its CREATED_AT/UPDATED_AT columns nulled out. This will lead to unexpected null return value from BelongsToMany::createdAt/updatedAt methods.

This PR adds fallback values (default created_at/updated_at column names) to fix this issue.

@taylorotwell taylorotwell merged commit c004ffc into laravel:11.x Oct 10, 2024
33 checks passed
@daniser daniser deleted the fix/pivot-timestamps-fallback branch October 10, 2024 15:57
timacdonald pushed a commit to timacdonald/framework that referenced this pull request Oct 15, 2024
…ation missing one or both of timestamps (laravel#53103)

Co-authored-by: Sergey Danilchenko <s.danilchenko@ttbooking.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants