Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration with Eloquent Eager Limit #173

Open
lannodev opened this issue Apr 2, 2024 · 5 comments · May be fixed by #180
Open

Integration with Eloquent Eager Limit #173

lannodev opened this issue Apr 2, 2024 · 5 comments · May be fixed by #180

Comments

@lannodev
Copy link

lannodev commented Apr 2, 2024

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
Copy link

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

@parkourben99
Copy link

@lannodev did you get this working? I'm also running into this issues updating a project to laravel 11.

@lannodev
Copy link
Author

Hi @parkourben99
My project is still in version 10.
I don't know how to implement this feature =/

@parkourben99
Copy link

I'll give it a go next week. Will let you know how I go.

@parkourben99 parkourben99 linked a pull request Nov 17, 2024 that will close this issue
@parkourben99
Copy link

parkourben99 commented Nov 17, 2024

I'll give it a go next week. Will let you know how I go.

I've created a PR #180 testing it on my project at the moment. I suspect it'll need to be extended to support other database types, not just MySql. Give it a go, see if it works for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants