Skip to content

fix(laravel): preserve custom builders in model query factories - #448

Open
shuvroroy wants to merge 2 commits into
PHPantom-dev:mainfrom
shuvroroy:fix/l55-model-query-builders
Open

shuvroroy wants to merge 2 commits into
PHPantom-dev:mainfrom
shuvroroy:fix/l55-model-query-builders

Conversation

@shuvroroy

Copy link
Copy Markdown
Contributor

Model instance factories returned the base Eloquent builder even when static queries used the model’s custom builder. Correct the factory methods’ instance/static distinction and preserve the custom builder and model through newQuery(), newModelQuery(), and newQueryWithoutScopes().

Existing declarations retain their signatures and source metadata; explicit return types that select another builder or model remain authoritative. Return-type transformations use the existing interning cache.

Adds regression coverage for generic and non-generic builders, inherited configuration, explicit overrides, completion, and runtime behavior. Removes completed L55 from the backlog.

Stack: depends on #447. This stacked PR targets upstream main, so its diff includes the unmerged dependency. The L55 change is commit 7d608a7e; merge the dependency 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

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

This branch has not been deployed

No deployments
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