Conversation
|
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
This was referenced Sep 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
withWhereHas()invokes its constraint with a related builder for the existence query and a relation for eager loading. Callback inference previously retained only the builder. Preserve the terminal instantiated relation alongside the model's custom builder, including through fluent calls, dotted paths, and explicitBuilder|Relationhints. Apply the same inference towithWhereRelation().The shared relation-chain resolver now retains the terminal relation and binds its declaring model to the fresh instance used for eager loading. It iterates path segments without collecting them and avoids fully resolving the final model merely to retrieve its name. Ordinary relation constraints still receive their related builder.
Adds type assertions, completion and diagnostic regressions, invalid-path tests, Laravel demos, and runtime assertions for both callback invocations. All audit expectations are now active. Removes completed L59 from the backlog.
Stack: depends on #451 (L58), above #450, #449, #448, and #447. This stacked PR targets upstream
main, so its diff includes the unmerged dependencies. The final commit contains L59; merge the dependencies first.Validation: full cargo test, both required clippy runs, cargo fmt --check, PHP syntax/runtime assertions, and Laravel analysis with exactly its three intentional diagnostics.
Framework observation: Laravel 13.24 strips
:columnsfor thewithWhereHas()existence query but retains the suffix in the eager-load key when a callback is provided. PHPantom's callback inference follows Larastan's stripped relation lookup; the runtime suffix assertion verifies the existence phase. Recommend a separate Laravel issue for the eager-load key behavior.