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
Copy file name to clipboardExpand all lines: docs/todo-laravel.md
+53-12Lines changed: 53 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,7 +74,27 @@ benefit) and an **Effort** estimate (implementation complexity):
74
74
75
75
---
76
76
77
-
#### 1. `$dates` array (deprecated)
77
+
#### 1. `morphedByMany` missing from relationship method map
78
+
79
+
|||
80
+
|---|---|
81
+
|**Impact**| ★★ — Any model using `morphedByMany` (the inverse of a polymorphic many-to-many) gets no virtual property or `_count` property for that relationship. |
82
+
|**Effort**| ★ — One-line addition to `RELATIONSHIP_METHOD_MAP` in `virtual_members/laravel.rs`. |
83
+
84
+
`morphedByMany` is the inverse side of a polymorphic many-to-many
85
+
relationship. It returns a `MorphToMany` instance (the same class as
86
+
`morphToMany`), but the method name is not listed in
87
+
`RELATIONSHIP_METHOD_MAP`. This means body inference
88
+
(`infer_relationship_from_body`) does not recognise
89
+
`$this->morphedByMany(Tag::class)` calls, so no virtual property or
90
+
`_count` property is synthesized.
91
+
92
+
**Where to change:** Add `("morphedByMany", "MorphToMany")` to
93
+
`RELATIONSHIP_METHOD_MAP` in `src/virtual_members/laravel.rs`.
94
+
No other changes needed since `MorphToMany` is already in
95
+
`COLLECTION_RELATIONSHIPS`.
96
+
97
+
#### 2. `$dates` array (deprecated)
78
98
79
99
|||
80
100
|---|---|
@@ -93,7 +113,7 @@ Merge these into `casts_definitions` at a lower priority than explicit
93
113
`$casts` entries, or add a separate field on `ClassInfo` and handle
0 commit comments