fico7489/laravel-eloquent-join
Laravel Eloquent Join adds SQL JOIN support to Eloquent models and relationships, letting you sort, filter, and query joined tables directly while keeping familiar query builder syntax. It simplifies complex relationship queries and helps avoid extra queries.
JOIN clauses scattered across repositories with a relationship-aware API (joinRelationship), reducing custom query code and the maintenance burden that comes with it. For a 339-star, MIT-licensed package with a 2025 release, this is a low-cost dependency bet.belongsTo/hasMany relations, and the current approach (eager loading plus in-memory sorting) is causing slow responses, high memory use, or incorrect pagination.withCount/withAggregate, whereHas subqueries, or caching.select discipline joins require (ambiguous columns, duplicate hydration) or cannot invest in query-level tests.For executives: This is a small, MIT-licensed addition that lets us ship faster, more flexible list and reporting screens—sorting and filtering by related data—without loading unnecessary records. Expected outcomes are quicker page loads, lower database load, and less custom query code to maintain. Cost is low and the package is actively released; the main investment is engineering validation time.
For engineering: fico7489/laravel-eloquent-join adds relationship-aware joins to Eloquent, so we can move filtering, sorting, and pagination into SQL while keeping model-defined relationship semantics instead of hand-writing joins. It reduces N+1 and over-fetching on read-heavy endpoints and consolidates join logic in one place. Adoption requires care around column selection, ambiguous names, global scopes, and index coverage, plus tests for each joined query. Recommended first step: pilot on one high-traffic index endpoint, measure query count and response time, then standardize if results hold.
How can I help you explore Laravel packages today?