BelongsTo relationships into a single optimized LEFT JOIN query, improving API/database response times (critical for high-traffic applications or read-heavy workloads).with() chain in legacy queries).User::with('posts.tags')->get()).Order::includes('customer')->where('customer.name', 'like', '%John%')->get()).Adopt When:
BelongsTo relationships (verify with Laravel Debugbar or query logs).orderBy('user.name')) but with() alone doesn’t suffice.Look Elsewhere If:
references().afterFind hooks) that conflict with JOIN optimizations.with() + custom scopes or database views offer better long-term scalability.For Executives:
"This package lets us cut database queries by 90% for common read operations by converting nested BelongsTo loads into single optimized queries. For example, a dashboard showing users with their orders would go from 100+ queries to 1—slashing latency and server costs. It’s a low-risk, high-reward fix for performance bottlenecks, with minimal dev effort since it integrates seamlessly into existing Laravel code. The MIT license means no vendor lock-in."
For Engineering:
*"Problem: Our with() chains trigger N+1 queries when filtering/sorting related data (e.g., User::with('posts')->orderBy('posts.title')).
Solution: sleeping-owl/with-join replaces eager-loaded subqueries with a single LEFT JOIN, preserving Eloquent’s API. Tradeoffs:
with())./api/reports) to measure impact before rolling out broadly. Pair with Laravel Debugbar to validate query reductions."*How can I help you explore Laravel packages today?