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

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.

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.

Sign in to participate in this thread!


Your banner here too?


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

Your logo here?

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

© 2024 - All rights reserved.