Skip to content

Conversation

@hannrei
Copy link
Contributor

@hannrei hannrei commented Nov 26, 2025

Fixes #57887

This PR fixes an issue where  whereDoesntHaveMorph('relation', '*')  on a nullable morph relationship generates SQL with an ungrouped  OR  expression.

As a result, the  whereDoesntHaveMorph('relation', '*')  constraint does not compose correctly with other query constraints and is not commutative, leading to unexpected results when combined with additional  where  clauses.

@taylorotwell taylorotwell merged commit 109efba into laravel:12.x Nov 27, 2025
73 of 74 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.

[Eloquent] whereDoesntHaveMorph('relation', '*') generates ungrouped OR

2 participants