Closed
Description
- Laravel Version: 5.7.13
- PHP Version: 7.2.11
- Database Driver & Version: Mysql 8.0.12
Description:
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().