Support the ongoing development of Laravel.io →
Database Eloquent
Last updated 2 years ago.
0

Not sure why take(3) wouldn't return anything. I just tried and it works as expected. You sure you posted the exact code you're using?

Reason why take(10) returns 4 rows is most likely because there are only 4 rows in your DB that match your criteria.

Run: select count(*) from objects where user_id = USER_ID and owned=1;

and you should get 4.

Last updated 2 years ago.
0

Yeah, I posted the exact code. The criteria was matching correctly.

The error turned out to be completely unrelated to Laravel - problem solved.

Thanks for responding.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.