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] Exclude laravel_through_key when replicating model, fixes #51097 #51098

Merged
merged 2 commits into from Apr 17, 2024

Conversation

levu42
Copy link
Contributor

@levu42 levu42 commented Apr 17, 2024

Currently, when replicating a model that was loaded via a HasManyThrough relation, the laravel_through_key stays included in the attributes, meaning it can't be saved unless manually removed. See #51097 for details including a reproducing repository.

This patch fixes that by adding laravel_through_key to the columns that are not replicated. I also included a test for it that fails without my patch and passes with my patch.

@taylorotwell taylorotwell merged commit 4e3de10 into laravel:11.x Apr 17, 2024
28 checks passed
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.

None yet

2 participants