Skip to main content

"Unplanned" Bug; Fixing Limitation Query

Premium
7 min read

This will be kind of an "offtopic" lesson: I realized I introduced a bug quite a long time ago, and decided to dedicate a full separate lesson about not only how to fix it, but how to properly write tests.

Remember in the property search lesson I realized that we need to return one apartment per property? I fixed it like this, by using take(1). Well, "fixed", I will show you why this approach is incorrect...

The Full Lesson is Only for Premium Members

Want to access all of our courses? (30 h 33 min)

You also get:

55 courses
Premium tutorials
Access to repositories
Private Discord
Get Premium for $129/year or $29/month

Already a member? Login here

Comments & Discussion

AA
Ali Al Qahtani ✓ Link copied!

In PropertySearchTest I note repeating codes

create second property "$propert2" with 3 apartments

PK
Povilas Korop ✓ Link copied!

Well spotted! Fixed that, thanks.

DS
Dmytro Sakharuk ✓ Link copied!

It is very good that this problem has been fixed in laravel 11, and we can do eager limit without a third-party package.

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.