kirschbaum-development/eloquent-power-joins
Eloquent Power Joins brings Laravel's magic to joins: define joins using your relationship methods, use model scopes in any context, query relationship existence via joins instead of where exists, and sort by related columns or aggregates with less code.
Architecture fit
whereHas, nested relationship filters, or manual joins.where exists semantics are specifically required. The package changes query shape, not domain behavior, so adoption should be scoped to query-layer concerns.Integration feasibility
whereHas, join, and orderBy calls can remain untouched until individually replaced.Technical risk
powerJoinHas and related methods are not drop-in equivalents of has/whereHas in all contexts. Row multiplication, duplicate records, and aggregate behavior must be validated per query.select *.withGlobalScopes(). Global scopes that type-hint Eloquent\Builder may fail in join context.morphTo joins support only one morphable type at a time. Morph maps and type values must match application conventions.Key questions
where exists semantics or exact row counts?Stack fit
Migration path
whereHas and manual joins available as fallbacks. Adoption should be reversible per query, not per application.Compatibility
illuminate/* constraints during dependency resolution.distinct behavior.Sequencing
Maintenance
Support
Scaling
where exists queries on large datasets when indexes are correct, especially for sorting and filtering across relationships.distinct, grouping, or aggregate queries deliberately, and verify counts.orderByPowerJoinsCount and aggregate ordering can be expensive without proper indexing.Failure modes
whereHas behavior.Ramp-up
powerJoinHas, aggregate ordering, or aliased nested joins until the team has established confidence.How can I help you explore Laravel packages today?