-
Notifications
You must be signed in to change notification settings - Fork 75
Dynamic where{Column} methods not resolved on relation chains #647
Copy link
Copy link
Open
Labels
Description
Problem
Laravel's __call magic on Builder supports dynamic where{Column} methods (e.g., whereEmail('foo') → where('email', '=', 'foo')). These are not resolved when called through a relation.
// ❌ UndefinedMagicMethod
$user->posts()->whereTitle('foo')->get();
$user->posts()->whereSlug('bar')->first();
// ✅ Equivalent explicit call works
$user->posts()->where('title', 'foo')->get();Priority
Low — explicit where() is the more common pattern, but dynamic where{Column} is used in some codebases.
Related
- Scopes not resolved on relation chains #646 — scopes not resolved on relation chains (same forwarding gap, different method source)
Reactions are currently unavailable