tjbp/eloquent-joins
Eloquent Joins adds relationship-aware join helpers to Laravel's query builder, letting you join tables through model relations and reuse constraints without hand-writing ON clauses. A small package that keeps joined queries readable and DRY.
Architecture fit. The package is a thin extension of Laravel's Eloquent ORM, adding join support at the relationship-definition level rather than at the query-builder call site. Architecturally it sits in the data-access layer and has a small blast radius, but it depends on Eloquent internals (relation query construction and builder macros) that are not a stable public contract. That makes it a poor long-term architectural dependency even though it "fits" a Laravel monolith on paper.
Integration feasibility. Composer installation is trivial, but the repository is archived, so framework version constraints are almost certainly stale (likely Laravel 5/6/7-era). Integration is realistic only on a legacy, pinned Laravel stack where the team accepts the constraints. On Laravel 9+, native features (joinRelationship, whereHas, whereRelation, hasManyThrough, withAggregate) cover most of the same use cases without a third-party dependency.
Technical risk. High. Specific concerns:
distinct/groupBy is applied carefully; this can silently corrupt aggregates and pagination.Key questions.
Stack fit. Only viable if the application is on a compatible Laravel version and legal accepts GPL-3.0. It is not a fit for new greenfield services on current Laravel.
Migration path. Default recommendation: do not adopt; express the requirement with native Eloquent (joinRelationship, whereHas, hasManyThrough, withAggregate). If a legacy feature already depends on the package, wrap the affected queries behind a repository/query-object boundary, add characterization tests that lock current result sets, and replace the package incrementally behind that seam.
Compatibility. Verify Composer constraints against the framework version, audit transitive dependencies, and run the full query/integration test suite. Check for conflicts with other Eloquent extensions (global scopes, soft deletes, custom builder macros). Confirm behavior with soft-deleted models and polymorphic relations, which are common breakage points for relationship-level join packages.
Sequencing.
Maintenance. Effectively zero upstream maintenance. Any fix, security patch, or framework-compatibility update becomes our responsibility via an internal fork. That is a recurring engineering cost disproportionate to the package's small feature surface.
Support. Community-only, no SLA, no vendor. Incident resolution is self-service; the archived status means issues and PRs will not be addressed. Runbooks must assume we own the code.
Scaling. SQL joins themselves are usually efficient, but relationship-generated joins can multiply rows, inflating result sets and breaking pagination counts and aggregates. Monitor slow-query logs and row counts on joined paths; require distinct/groupBy and explicit index review before using on high-cardinality relationships.
Failure modes.
Ramp-up. Low API learning curve for engineers, but high organizational cost: legal review, fork ownership, upgrade monitoring, and eventual replacement work. Net recommendation for a TPM: treat this as legacy/contain-only, block new adoption, and budget a replacement with native Eloquent features.
How can I help you explore Laravel packages today?