Skip to content

[7.x] Correcting description for whereDoesntHave #6196

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

Merged
merged 2 commits into from
Jul 24, 2020

Conversation

DoDSoftware
Copy link
Contributor

The description of the example using whereDoesntHave with a nested relationship did not correctly describe the behavior of the function. Updated with correct description.

Originally brought to attention by 0xN0 via this SO Question

The description of the example using whereDoesntHave with a nested relationship did not correctly describe the behavior of the function. Updated with correct description.
@driesvints driesvints changed the title Correcting description for whereDoesntHave [7.x] Correcting description for whereDoesntHave Jul 24, 2020
@taylorotwell taylorotwell merged commit a1da33e into laravel:7.x Jul 24, 2020
@MitchTalmadge
Copy link

MitchTalmadge commented Jul 14, 2023

Am I misunderstanding something? The SO question and the original change to the wording (24cc0f0) say that this query will:

  • Fetch all posts with 0 comments AND,
  • Fetch all posts where ALL comment authors are banned.

...the following query will retrieve all posts that have no comments, or where all comments are from banned authors:

But commit 50303d1 overwrites that wording change to suggest that the query will:

  • Fetch all posts with 0 comments AND,
  • Fetch all posts where AT LEAST ONE comment has an author that IS NOT banned.

...the following query will retrieve all posts that do not have comments and posts that have comments from authors that are not banned:

These are two completely different explanations. Which is correct? Why did this get changed & merged without further review?

Tangent to this -- what is the query trying to practically show, anyway? Why would you want to fetch posts with 0 comments or posts where a comment has not been banned? I feel like this entire situation could be resolved with a better example.

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.

3 participants