You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I checked my query logs, and the order by and select are never applied:
select * from "comments" where "comments"."article_id" in (410)
Once I turned off prevent lazy loading:
select "id", "article_id", "parent_id", "user_id", "body", "created_at" from "comments" where "comments"."article_id" in (410) order by "created_at" asc
I don't know why this would be the case, but it's very strange - I'm eager loading the relationship, and just adding constraints.
Steps To Reproduce
Turn off lazy loading:
Model::preventLazyLoading(true);
Now, in any model, constrain the query with any clause - you'll note that the clause is never applied. It appears to be ignoring them.
The text was updated successfully, but these errors were encountered:
Laravel Version
10.44.0
PHP Version
8.3
Database Driver & Version
Postgres 15.1 on Mac Ventura M2 13.6.2
Description
Found a really weird bug - took me all day to find it. Basically, if you have the following enabled:
Eager loaded constraints like the following are not applied:
I checked my query logs, and the order by and select are never applied:
Once I turned off prevent lazy loading:
I don't know why this would be the case, but it's very strange - I'm eager loading the relationship, and just adding constraints.
Steps To Reproduce
Turn off lazy loading:
Now, in any model, constrain the query with any clause - you'll note that the clause is never applied. It appears to be ignoring them.
The text was updated successfully, but these errors were encountered: