audunru/eager-load-pivot-relations
BelongsToMany relationships with pivot attributes or relations, improving API/database response times (critical for procurement, inventory, or multi-table systems).plan_item pivot with unit_id + quantity).order_item pivot with size, color).user_plan pivot with discount_code).tenant_feature with activation_date).Adopt When:
BelongsToMany pivots contain additional relations or attributes that cause N+1 queries (e.g., unit_id in plan_item).Look Elsewhere If:
withPivot() suffices.ajcastro/eager-load-pivot-relations.For Executives: "This package solves a hidden performance bottleneck in our [procurement/inventory/e-commerce] system. Currently, loading pivot relations (e.g., unit conversions for plan items) triggers dozens of extra database queries, slowing down critical workflows. By adopting this lightweight Laravel package, we’ll reduce latency by 30–50% with minimal dev effort—comparable to a backend optimization sprint but delivered in hours. It’s a no-brainer for scaling our [feature X] without hiring additional engineers."
For Engineering:
*"This is a battle-tested fork of a well-known package, updated for Laravel 8+. It lets us eager-load pivot relations (e.g., Item::with('plans.units')->get()) without writing custom queries or hitting N+1 hell. Key benefits:
composer require and use the EagerLoadPivotTrait.How can I help you explore Laravel packages today?