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

[11.x] use exists() instead of count() #53328

Merged
merged 2 commits into from
Oct 29, 2024

Conversation

browner12
Copy link
Contributor

we only need to check for existence of a record here, not for the actual count, and exists() is generally more performant than a count.

we only need to check for existence of a record here, not for the actual count, and `exists()` is generally more performant than a count.
- add an "exists" assertions, and update `mockCountBuilder()` to accept this first, and adjust all the calls to it.
- I thought about renaming `mockCountBuilder()` to `mockBuilder()`, which would probably be a little clearer now, but I wanted to keep this easy to review. if this is accepted, I'd probably go back and make that semantic change separately.
@taylorotwell taylorotwell merged commit 36b6991 into laravel:11.x Oct 29, 2024
31 checks passed
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 this pull request may close these issues.

2 participants