Skip to content

Conversation

@owenvoke
Copy link
Contributor

@owenvoke owenvoke commented Mar 5, 2025

This resolves an issue with the whereNotMorphedTo() method where the query results in a double negative. This changes to a format that resembles the previous logic.

This issue was introduced in a previous PR (see my comment).

Previous Logic (<11.40)

select *
from `posts`
where not (`posts`.`author_type` <=> 'user' and `posts`.`author_id` <=> 1)

Current logic (>=11.40)

select *
from `posts`
where not ((`posts`.`author_type` <=> 'user' and `posts`.`author_id` not in (1)))

Updated logic (this PR)

This logic aligns more with the previous logic, which does not have a double negative.

select *
from `posts`
where not ((`posts`.`author_type` <=> 'user' and `posts`.`author_id` in (1)))

This resolves an issue with the `whereNotMorphedTo()` method where
the query results in a double negative. This changes to a format
that resembles the previous logic.
@owenvoke owenvoke force-pushed the bugfix/where-not-morphed-to branch from 7786cf4 to 0f3eb4f Compare March 5, 2025 11:55
@taylorotwell taylorotwell merged commit 3bc6805 into laravel:11.x Mar 5, 2025
44 checks passed
@owenvoke owenvoke deleted the bugfix/where-not-morphed-to branch March 5, 2025 16:36
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