mpyw/eloquent-has-by-non-dependent-subquery
has()/whereHas() relationships, especially when dealing with large tables or nested relationships. This can be a key differentiator for scaling read-heavy applications.Adopt When:
has()/whereHas() due to correlated subqueries.Look Elsewhere When:
For Executives: "This package optimizes database queries in our Laravel app by converting slow, nested relationship checks (e.g., 'find users with 10+ orders') into faster, non-dependent subqueries—specifically for MySQL databases. For applications with heavy read loads or complex data hierarchies, this could reduce query times by 20–50% with minimal code changes. It’s a low-risk, high-reward fix for legacy systems or cost-sensitive deployments where upgrading MySQL isn’t an option. Since it’s MIT-licensed and integrates seamlessly with Eloquent, we avoid custom development costs."
For Engineering:
*"This is a targeted performance boost for MySQL < 8.0.16 environments where correlated subqueries in has()/whereHas() become bottlenecks. It’s a one-line composer install with zero runtime overhead—just flip a switch to rewrite queries as non-dependent subqueries. Ideal for:
Tradeoff: Not needed for MySQL 8.0.16+ or PostgreSQL. Maintenance is passive (package is archived but functionally sound)."*
How can I help you explore Laravel packages today?