Skip to content

fix(laravel): retain custom builders in relation callbacks - #449

Open
shuvroroy wants to merge 3 commits into
PHPantom-dev:mainfrom
shuvroroy:fix/l56-relation-custom-builders
Open

shuvroroy wants to merge 3 commits into
PHPantom-dev:mainfrom
shuvroroy:fix/l56-relation-custom-builders

Conversation

@shuvroroy

Copy link
Copy Markdown
Contributor

Relation callbacks lost custom builders in two places: custom query receivers were not recognized as model builders, and related models always became the base Builder. Use the receiver’s existing resolved generic context and share the model builder selector with static forwarding, including inherited configuration and non-generic custom builders.

A bare parent-class parameter hint can now retain an inferred generic subclass. Explicit incompatible hints remain authoritative. Adds type, completion, diagnostic, and Laravel runtime regressions, and removes completed L56 from the backlog.

Stack: depends on #448, above upstream audit #447. This stacked PR targets upstream main, so its diff includes the unmerged dependencies. The L56 change is commit e419ac0f; 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.

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 94.69027% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/type_engine/variable/closure_resolution.rs 88.63% 5 Missing ⚠️
src/virtual_members/laravel/builder.rs 98.38% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

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