topclaudy / compoships

Multi-columns relationships for Laravel's Eloquent ORM
MIT License
1.09k stars 131 forks source link

Integration with Eloquent Eager Limit #173

Open lannodev opened 4 months ago

lannodev commented 4 months ago

Before Laravel 11 to use compoships with Eloquent Eager Limit it was necessary to use this Compoships Eager Limit package. Now the Eloquent Eager Limit package is native on Laravel. Please, its possible to make compoships to works with it ?

Using just compoships in laravel 11 I get the following error: stripos(): Argument #1 ($haystack) must be of type string, array given

example:

User::with([
    'posts' => fn ($query) => $query->limit(3)
])->paginate();

All the best

parallels999 commented 1 month ago

Feel free to open a PR with the upgrade, don't forget to add some tests