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
When using the whereAttachedTo method, the entire model and all its properties are sent into whereKey which then converts all columns to an integer and adds them to the whereIn clause. This means a bunch of 0's are added for empty strings / null values, which is unlikely to cause an issue but is still unintended behaviour. But integer and datetime columns add a bunch of potentially valid IDs which should not be included in the query.
Steps To Reproduce
Create a belongsToMany or MorphToMany relationship between two models.
Write an Eloquent query including the whereAttachedTo method and pass the other model in. Either call ddRawSql on this query or call get and inspect the DB query log.