ardalanamini/laravel-custom-relation
A Laravel package that lets you define custom Eloquent relationships beyond the built-in hasMany, belongsTo, and morphTo types. Build relations with your own query logic and constraints, keeping complex model associations flexible and readable.
|
Package
|
Score
|
Description
|
Stars
|
Likes
|
Forks
|
Downloads
|
Issues
|
Score
|
Opportunity
|
License
|
Last Release
|
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| staudenmeir/eloquent-has-many-deep | 0.86 | Extended HasManyThrough for Laravel 5.5+ lets you define relationships with unlimited intermediate models, supporting many-to-many, polymorphic, and combined relationship types. Define deep relationships by concatenating existing ones or specifying keys manually; includes third-party package support... | 2,872 | 2,876 | 157 | 943K | 2 | 36.4 | 36.8 | MIT | 7 months ago | |
| staudenmeir/eloquent-has-many-deep-contracts | 0.85 | Contracts for staudenmeir/eloquent-has-many-deep. Includes the ConcatenableRelation contract to make third-party relationship packages concatenable with HasManyDeep, improving interoperability when combining deep Eloquent relations. | 7 | 7 | 1 | 1M | 0 | 8.2 | 58.4 | MIT | 8 months ago | |
| reedware/laravel-composite-relations | 0.85 | Adds composite foreign key support to Eloquent relationships. Define Belongs To, Has One, and Has Many relations using multiple columns, with full eager loading and "where has" query support through a simple trait on your base model. | 22 | 22 | 8 | 9K | 0 | 16.7 | 40.0 | MIT | 4 months ago | |
| stayallive/laravel-inverse-relations | 0.84 | — | 31 | 31 | 1 | 0 | 0 | 1.4 | — | MIT | 2 years ago | |
| fico7489/laravel-eloquent-join | 0.84 | 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. | 338 | — | 87 | — | 11 | 7.6 | 4.1 | MIT | 1 year ago |
|
| culturegr/custom-relation | 0.84 | Easily define custom relationships between Eloquent models, like connecting users to permissions through roles. Includes an Artisan generator and full support for eager-loading, making complex multi-table joins clean and reusable. | 18 | 18 | 4 | 165 | 1 | 21.4 | 15.7 | NOASSERTION | 1 month ago | |
| korridor/laravel-has-many-merged | 0.84 | Adds a hasManyMerged relationship to Laravel Eloquent, letting you combine several hasMany relations across models into one query-backed collection with sorting, limits, and eager loading. Ideal for unified feeds, timelines, and activity lists. | 90 | 90 | 3 | 7K | 4 | 13.1 | 30.4 | MIT | 6 months ago | |
| midnightluke/doctrine-relations | 0.84 | Adds Laravel-style relationships to Doctrine entities, letting you define hasOne, hasMany, belongsTo, and belongsToMany associations with simple attributes and query them through an intuitive, Eloquent-like API. | 0 | 0 | 0 | 0 | 0 | 0.0 | — | MIT | — | |
| orkhanahmadov/eloquent-repository | 0.84 | — | 27 | 27 | 11 | 226 | 2 | 2.3 | 14.0 | MIT | 4 years ago | |
| stancl/laravel-hasmanywithinverse | 0.84 | Laravel's hasMany leaves the inverse relation unset, so accessing the parent from each child triggers extra queries. This package adds hasManyWithinverse, which hydrates the inverse automatically—so $child->parent is already loaded without N+1. | 69 | — | 5 | — | 1 | 0.9 | — | MIT | 3 years ago | |
| staudenmeir/laravel-merged-relations | 0.83 | Merge multiple Laravel Eloquent relations into a single relation that can be queried and eager loaded as one. Combine hasMany, belongsToMany, and morph relations into a unified result set, simplifying complex relationship handling in your models. | 185 | 186 | 12 | 53K | 1 | 9.6 | 36.2 | MIT | 7 months ago | |
| sly/relation-bundle | 0.83 | A lightweight PHP package for defining and managing relationships between models. It simplifies linking records, querying related data, and keeping relation logic reusable, with a clean API that fits naturally into existing Eloquent workflows. | 10 | 10 | 6 | 0 | 0 | 0.2 | — | — | — | |
| ankurk91/laravel-eloquent-relationships | 0.83 | — | 58 | 59 | 9 | 8K | 0 | 0.3 | 20.7 | MIT | — | |
| kingmaker/laravel-many-to-many-self-relationship | 0.82 | A Laravel Eloquent package for many-to-many self-referential relationships like followers/following, friends, or related models. It provides a reusable trait for managing pivot records, inverse relations, and attach/detach-style operations cleanly. | 18 | 19 | 2 | 8K | 1 | 0.3 | 36.0 | — | — | |
| mr-punyapal/laravel-extended-relationships | 0.82 | Extra Eloquent relationship helpers for Laravel that cut database queries, improve performance, and reduce duplicate code. Requires PHP 8.3+ and Laravel 12/13, with easy Composer installation. | 174 | 174 | 8 | 1K | 1 | 21.2 | 14.0 | MIT | 2 months ago | |
| zing/laravel-eloquent-relationships | 0.81 | — | 8 | 8 | 0 | 39K | 1 | 22.4 | 58.5 | MIT | 3 weeks ago | |
| staudenmeir/eloquent-json-relations | 0.81 | Adds JSON foreign key support to Laravel Eloquent relationships (belongsTo, hasMany, morph*, through). Also enables many-to-many and has-many-through relations using JSON arrays (IDs or objects) across MySQL, Postgres, SQLite, SQL Server. | 1,080 | 1,084 | 64 | 344K | 6 | 24.2 | 37.9 | MIT | 8 months ago | |
| psalm/plugin-laravel | 0.80 | Laravel static analysis with built-in taint-based security scanning: traces user input from request to sink to catch SQL injection, XSS, shell injection, file traversal, SSRF, open redirects and timing-unsafe secret comparisons. Runs locally and in CI, no account or cloud upload. | 346 | 346 | 79 | 142K | 103 | 59.0 | 69.7 | MIT | 1 week ago | |
| laravel-lang/config | 0.80 | Official configuration package for Laravel Lang, providing shared settings and defaults used across its localization tools so you can manage language files and locales consistently in Laravel apps. | 6 | 6 | 1 | 529K | 0 | 28.4 | 64.3 | MIT | 1 month ago | |
| audunru/eager-load-pivot-relations | 0.80 | Eager load relations on pivot models in Laravel Eloquent BelongsToMany relationships. Add the EagerLoadPivotTrait to the related model to load nested pivot data such as units or quantities. Supports Laravel 8 and above. | 9 | 9 | 1 | 4K | 1 | 14.8 | 39.8 | — | 5 months ago |
How can I help you explore Laravel packages today?