Skip to content

Conversation

willrowe
Copy link
Contributor

@willrowe willrowe commented Aug 29, 2025

This is another attempt to fix #43800. In the documentation, polymorphic relationships use pivot tables with plural names. However, the Pivot model class does not take that into account when automatically generating the table name since standard (non-polymorphic) pivot tables use singular names and the MorphPivot class extends from it.

The tests never properly covered this case since all usages of the MorphPivot class set the table name explicitly since it does not match the class names.

This is a breaking change because existing code could be depending on the morph pivot table name being singular in order to work around the bug.

@willrowe willrowe force-pushed the feature/morph-pivot-table-name branch from c370e1b to b34304e Compare August 29, 2025 18:51
@willrowe
Copy link
Contributor Author

The failing tests seem to be due to some unrelated deprecation notices.

@taylorotwell taylorotwell merged commit 6ac2f35 into laravel:master Sep 4, 2025
19 of 44 checks passed
@willrowe willrowe deleted the feature/morph-pivot-table-name branch September 4, 2025 13:39
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