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 and staudenmeir/laravel-cte to allow them being used in the same model.
Supports Laravel 9–10.
composer require staudenmeir/eloquent-eager-limit-x-laravel-cte:"^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-cte:"^^^^1.0"
Laravel | Package |
---|---|
10.x | 1.1 |
9.x | 1.0 |
Use the HasEagerLimitAndQueriesExpressions
trait in your model:
class User extends Model
{
use \Staudenmeir\EloquentEagerLimitXLaravelCte\Eloquent\HasEagerLimitAndQueriesExpressions;
}
Please see CONTRIBUTING and CODE OF CONDUCT for details.