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 use withCount under the relation morphMany and when withCount method call before select method, It will lead that the where bindings will make a mistake.
Steps To Reproduce:
ModelA::withCount('relation')->where(''user_id", 12)->select(['fields'])->get() or paginate().
It will cause where bindings make a mistake. And when select method call before the withCount method, It will be OK. Like this :
ModelA::select(['fields'])->withCount('relation')->where(''user_id", 12)->get() or paginate().
The text was updated successfully, but these errors were encountered:
mitoop
changed the title
withCount where bindings mistake when relation is morphMany.
When relation is morphMany, withCount would cause where bindings mistake
Nov 27, 2018
Description:
When use withCount under the relation
morphMany
and whenwithCount
method call beforeselect method
, It will lead that the where bindings will make a mistake.Steps To Reproduce:
ModelA::withCount('relation')->where(''user_id", 12)->select(['fields'])->get() or paginate().
It will cause where bindings make a mistake. And when
select
method call before thewithCount
method, It will be OK. Like this :ModelA::select(['fields'])->withCount('relation')->where(''user_id", 12)->get() or paginate().
The text was updated successfully, but these errors were encountered: