- 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.