PHPackages                             staudenmeir/eloquent-eager-limit-x-laravel-adjacency-list - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. staudenmeir/eloquent-eager-limit-x-laravel-adjacency-list

ActiveLibrary[Database &amp; ORM](/categories/database)

staudenmeir/eloquent-eager-limit-x-laravel-adjacency-list
=========================================================

Merge of staudenmeir/eloquent-eager-limit and staudenmeir/laravel-adjacency-list

v1.2(3y ago)1431.9k↑38.6%1MITPHPPHP ^8.1

Since Mar 20Pushed 2y ago2 watchersCompare

[ Source](https://github.com/staudenmeir/eloquent-eager-limit-x-laravel-adjacency-list)[ Packagist](https://packagist.org/packages/staudenmeir/eloquent-eager-limit-x-laravel-adjacency-list)[ Fund](https://paypal.me/JonasStaudenmeir)[ RSS](/packages/staudenmeir-eloquent-eager-limit-x-laravel-adjacency-list/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (6)Versions (8)Used By (0)

Eloquent Eager Limit + Laravel Adjacency List
=============================================

[](#eloquent-eager-limit--laravel-adjacency-list)

[![CI](https://github.com/staudenmeir/eloquent-eager-limit-x-laravel-adjacency-list/actions/workflows/ci.yml/badge.svg)](https://github.com/staudenmeir/eloquent-eager-limit-x-laravel-adjacency-list/actions/workflows/ci.yml)[![Code Coverage](https://camo.githubusercontent.com/e87fbd002567c9017ad2e7acdd5b68d1e5e41b90049e23d24bae09987d8e0dde/68747470733a2f2f636f6465636f762e696f2f67682f7374617564656e6d6569722f656c6f7175656e742d65616765722d6c696d69742d782d6c61726176656c2d61646a6163656e63792d6c6973742f67726170682f62616467652e7376673f746f6b656e3d343846514c3657563054)](https://codecov.io/gh/staudenmeir/eloquent-eager-limit-x-laravel-adjacency-list)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/0040d18c1f11bbb8eb988929e96df920d95eb0100562651de1b08a007bf31fdb/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7374617564656e6d6569722f656c6f7175656e742d65616765722d6c696d69742d782d6c61726176656c2d61646a6163656e63792d6c6973742f6261646765732f7175616c6974792d73636f72652e706e673f623d6d61696e)](https://scrutinizer-ci.com/g/staudenmeir/eloquent-eager-limit-x-laravel-adjacency-list/?branch=main)[![Latest Stable Version](https://camo.githubusercontent.com/1c94bfc2556657057e8d1775455754e2a0ed0625708d51d90d494ccdd8e5594a/68747470733a2f2f706f7365722e707567782e6f72672f7374617564656e6d6569722f656c6f7175656e742d65616765722d6c696d69742d782d6c61726176656c2d61646a6163656e63792d6c6973742f762f737461626c65)](https://packagist.org/packages/staudenmeir/eloquent-eager-limit-x-laravel-adjacency-list)[![Total Downloads](https://camo.githubusercontent.com/024e9b291191805f4d856f024cd100b5329568bd6972d214a9d57eb842e626cd/68747470733a2f2f706f7365722e707567782e6f72672f7374617564656e6d6569722f656c6f7175656e742d65616765722d6c696d69742d782d6c61726176656c2d61646a6163656e63792d6c6973742f646f776e6c6f616473)](https://packagist.org/packages/staudenmeir/eloquent-eager-limit-x-laravel-adjacency-list/stats)[![License](https://camo.githubusercontent.com/150202e2ad6629e4d69ad978156d2661fb26fee1799fc9565978c77aa9b3fcb5/68747470733a2f2f706f7365722e707567782e6f72672f7374617564656e6d6569722f656c6f7175656e742d65616765722d6c696d69742d782d6c61726176656c2d61646a6163656e63792d6c6973742f6c6963656e7365)](https://github.com/staudenmeir/eloquent-eager-limit-x-laravel-adjacency-list/blob/main/LICENSE)

Important

The `staudenmeir/eloquent-eager-limit` package's code has been merged into Laravel 11+ and eager loading limits are now supported natively.

This Laravel package merges [staudenmeir/eloquent-eager-limit](https://github.com/staudenmeir/eloquent-eager-limit)and [staudenmeir/laravel-adjacency-list](https://github.com/staudenmeir/laravel-adjacency-list) to allow them being used in the same model.

Supports Laravel 9–10.

Installation
------------

[](#installation)

```
composer require staudenmeir/eloquent-eager-limit-x-laravel-adjacency-list:"^1.0"

```

Use this command if you are in PowerShell on Windows (e.g. in VS Code):

```
composer require staudenmeir/eloquent-eager-limit-x-laravel-adjacency-list:"^^^^1.0"

```

Versions
--------

[](#versions)

LaravelPackage10.x1.19.x1.0Usage
-----

[](#usage)

### Trees

[](#trees)

Use the `HasEagerLimitAndRecursiveRelationships` trait in your model:

```
class User extends Model
{
    use \Staudenmeir\EloquentEagerLimitXLaravelAdjacencyList\Eloquent\HasEagerLimitAndRecursiveRelationships;
}
```

#### Limitations

[](#limitations)

`Descendants` relationships only support eager loading limits when the query is ordered breadth-first (siblings before children):

```
$users = User::with([
    'descendants' => function ($query) {
        $query->breadthFirst()->limit(10);
    }
])->get();
```

`*OfDescendants` relationships do not support eager loading limits.

### Graphs

[](#graphs)

Use the `HasEagerLimitAndGraphRelationships` trait in your model:

```
class Node extends Model
{
    use \Staudenmeir\EloquentEagerLimitXLaravelAdjacencyList\Eloquent\HasEagerLimitAndGraphRelationships;
}
```

#### Limitations

[](#limitations-1)

Eager loading limits on graph relationships are not supported at the moment.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) and [CODE OF CONDUCT](.github/CODE_OF_CONDUCT.md) for details.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~70 days

Recently: every ~28 days

Total

7

Last Release

1101d ago

PHP version history (2 changes)v1.0PHP ^8.0.2

v1.1PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/3c1c3cda28d147c1899037c3187f89a606ca14f51190de59e88fa91e51647ff6?d=identicon)[staudenmeir](/maintainers/staudenmeir)

---

Top Contributors

[![staudenmeir](https://avatars.githubusercontent.com/u/1853169?v=4)](https://github.com/staudenmeir "staudenmeir (29 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/staudenmeir-eloquent-eager-limit-x-laravel-adjacency-list/health.svg)

```
[![Health](https://phpackages.com/badges/staudenmeir-eloquent-eager-limit-x-laravel-adjacency-list/health.svg)](https://phpackages.com/packages/staudenmeir-eloquent-eager-limit-x-laravel-adjacency-list)
```

###  Alternatives

[owen-it/laravel-auditing

Audit changes of your Eloquent models in Laravel

3.4k33.0M95](/packages/owen-it-laravel-auditing)[staudenmeir/eloquent-json-relations

Laravel Eloquent relationships with JSON keys

1.1k5.8M24](/packages/staudenmeir-eloquent-json-relations)[bavix/laravel-wallet

It's easy to work with a virtual wallet.

1.3k1.1M11](/packages/bavix-laravel-wallet)[dragon-code/migrate-db

Easy data transfer from one database to another

15717.4k](/packages/dragon-code-migrate-db)[gearbox-solutions/eloquent-filemaker

A package for getting FileMaker records as Eloquent models in Laravel

6454.8k2](/packages/gearbox-solutions-eloquent-filemaker)[cybercog/laravel-ownership

Laravel Ownership simplify management of Eloquent model's owner.

9126.6k3](/packages/cybercog-laravel-ownership)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
