reedware/laravel-composite-relations
user_id + permission_id).Order linked to both Customer and Store via customer_id + store_id).product_id + variant_id).whereHas clauses, which is critical for scalable applications.whereHas) for composite relations, which this package explicitly supports.belongsToMany with composite keys).For Executives: "This package allows our Laravel backend to handle complex database relationships—like linking orders to both customers and stores—using clean, Eloquent-style code instead of manual SQL. It’s a drop-in solution for legacy systems or multi-key schemas, reducing development time and technical debt. With an MIT license, minimal maintenance requirements, and compatibility with Laravel 11/12, it’s a low-risk way to unlock flexibility for projects where relational complexity is a bottleneck. For example, it could simplify multi-tenancy, hierarchical data, or financial systems where composite keys are common. The package is already adopted by 20+ projects, indicating its reliability."
For Engineering:
*"Composite relations in Laravel are a common pain point—this package fills that gap by supporting BelongsTo, HasOne, and HasMany with multi-column foreign keys. Here’s why it’s worth adopting:
$order->customerStore instead of custom queries).user_id + role_id).whereHas.belongsToMany or polymorphic composite relations (but covers 80% of use cases).For Data/Database Teams: *"This package provides a clean, Eloquent-based way to handle composite foreign keys without sacrificing query performance or maintainability. It’s particularly useful for:
user_id + tenant_id).WHERE (user_id = ? AND tenant_id = ?)).NULL values, duplicate keys).How can I help you explore Laravel packages today?