Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Eloquent Join

Laravel Eloquent Join Laravel Package

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.

Deep Wiki
Context7

fico7489/laravel-eloquent-join lets you join related tables using your existing Eloquent relationships instead of writing raw SQL join clauses. Define a relationship once, then filter, sort, and select columns across hasOne, belongsTo, hasMany, and belongsToMany relations with clean, reusable code.

  • joinRelationship() and leftJoinRelationship() with table aliases
  • Nested joins for deep relationship chains
  • Works with all standard relationship types, including many-to-many
  • Relationship-based where clauses and ordering by related columns
  • Eliminates duplicated, hand-written join conditions
Frequently asked questions about Laravel Eloquent Join
How do I install fico7489/laravel-eloquent-join in Laravel?
Install it with Composer using composer require fico7489/laravel-eloquent-join. The package is designed for Laravel applications that already use Eloquent. Confirm the supported Laravel and PHP versions in the package metadata before installing, and pin the version in composer.json for production use.
Which Laravel and PHP versions does laravel-eloquent-join support?
The exact supported Laravel and PHP ranges should be checked against the package Composer constraints and release notes before adoption. Because it may rely on Eloquent internals, test it against your specific Laravel minor version. Pin a known-good version and include Laravel upgrades in your compatibility review.
What relationship types can I join with this Eloquent join package?
The package adds join clauses to Eloquent models and the query builder, but you should verify coverage for hasMany, belongsTo, belongsToMany, nested, and polymorphic relationships in your version. Simple relationship joins are the safest starting point. For unsupported relation shapes, keep a native join or whereHas fallback.
Does laravel-eloquent-join respect soft deletes and global scopes?
Join generation can bypass Eloquent global scopes and soft-delete constraints unless the package explicitly adds those conditions. Test queries against models with SoftDeletes and global scopes to confirm row counts and hydrated results. If constraints are missing, add them manually or fall back to native Eloquent relationship queries.
Can I use table aliases and avoid ambiguous column errors with this package?
Ambiguous column names and alias collisions are a known risk when joining related tables. Check whether the package supports explicit table aliases and qualified column names in your queries. Use clear aliases and add regression tests for filtering, sorting, and pagination when multiple tables share column names.
Which databases are supported: MySQL, PostgreSQL, SQLite?
The package generates SQL joins, so portability depends on the SQL dialect and how the package builds clauses. Verify behavior on MySQL, PostgreSQL, and SQLite if your application uses more than one engine. Pay attention to identifier quoting, aliases, and any database-specific functions in your filters and sorts.
Is laravel-eloquent-join safe for production reporting queries?
It can be suitable for read-side reporting, admin filters, exports, and list views when introduced behind query objects or repository boundaries. Start with a narrow pilot, review query plans, and monitor slow queries because joins can multiply rows and complicate pagination counts. Avoid making it a domain-layer dependency or a replacement for well-modeled relationships.
How does this package handle pagination and duplicate hydrated models?
Joins can produce duplicate rows when a related table has multiple matches, which may affect pagination counts and hydrated model results. Test count queries, pagination, and eager loading with representative data. If duplicates appear, use distinct queries, grouping, or native relationship loading where appropriate.
What are alternatives to laravel-eloquent-join for filtering by related columns?
Native Eloquent whereHas, relationship queries, with eager loading, and raw join clauses remain viable alternatives. Use this package where it simplifies read-heavy join filters without broad refactoring. Keep a fallback path so unsupported relation shapes or Laravel upgrades do not block delivery.
Who maintains fico7489/laravel-eloquent-join and is the repository reliable?
It is a small community-maintained package with moderate adoption and an unknown repository source in the assessment, so provenance and bus factor should be reviewed. Pin versions, monitor releases, and document an internal escalation path. If it becomes central, consider forking it or replacing it with a small internal query helper.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core
nodisrupt/laravel-agent
sierratecnologia/media-manager