https://github.com/mpyw/compoships-eager-limit
topclaudy/compoships + staudenmeir/eloquent-eager-limit
https://github.com/mpyw/compoships-eager-limit
composite-keys eagerload eloquent laravel php
Last synced: 4 months ago
JSON representation
topclaudy/compoships + staudenmeir/eloquent-eager-limit
- Host: GitHub
- URL: https://github.com/mpyw/compoships-eager-limit
- Owner: mpyw
- License: mit
- Created: 2019-11-12T12:26:37.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-03-04T01:01:59.000Z (4 months ago)
- Last Synced: 2025-03-15T01:51:49.591Z (4 months ago)
- Topics: composite-keys, eagerload, eloquent, laravel, php
- Language: PHP
- Homepage:
- Size: 33.2 KB
- Stars: 13
- Watchers: 2
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Compoships Eager Limit [](https://github.com/mpyw/compoships-eager-limit/actions) [](https://coveralls.io/github/mpyw/compoships-eager-limit?branch=master) [](https://scrutinizer-ci.com/g/mpyw/compoships-eager-limit/?branch=master)
[topclaudy/compoships](https://github.com/topclaudy/compoships) + [staudenmeir/eloquent-eager-limit](https://github.com/staudenmeir/eloquent-eager-limit)
> [!CAUTION]
> [staudenmeir/eloquent-eager-limit](https://github.com/staudenmeir/eloquent-eager-limit) has been merged into the core since Laravel 11. Therefore, it should have been enough to only install [topclaudy/compoships](https://github.com/topclaudy/compoships)... However, as of March 2025, PR [topclaudy/compoships#180](https://github.com/topclaudy/compoships/pull/180) has not yet been merged. Once we have seen this merged, we will abandon the package.## Requirements
- PHP: `^8.0`
- Laravel: `^9.0 || ^10.0`
- [Compoships](https://github.com/topclaudy/compoships): `^2.0.4`
- [Eloquent Eager Limit](https://github.com/staudenmeir/eloquent-eager-limit): `^1.7.1`## Installing
```
composer require mpyw/compoships-eager-limit
```## Usage
```php
hasMany(Comment::class);
}public function authorComments()
{
return $this->hasMany(Comment::class, ['post_id', 'user_id'], ['id', 'user_id']);
}
}
``````php
function ($query) {
$query->limit(3)->offset(1);
}])->get();
```For more details, visit each base package repository.
- [topclaudy/compoships](https://github.com/topclaudy/compoships)
- [staudenmeir/eloquent-eager-limit](https://github.com/staudenmeir/eloquent-eager-limit)## Special Thanks
- **[@topclaudy](https://github.com/topclaudy)**
- **[@staudenmeir](https://github.com/staudenmeir)**