We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 72053cf commit 49a1932Copy full SHA for 49a1932
src/QueryBuilder/ModelLoader.php
@@ -123,12 +123,12 @@ public function loadMissing($includePaths): self
123
*/
124
public function loadCount($countable): self
125
{
126
- $counter = new CountableLoader(
127
- $this->schema,
128
- CountablePaths::cast($countable)
129
- );
+ $paths = CountablePaths::cast($countable);
130
131
- $this->target->loadCount($counter->getRelations());
+ if ($paths->isNotEmpty()) {
+ $counter = new CountableLoader($this->schema, $paths);
+ $this->target->loadCount($counter->getRelations());
+ }
132
133
return $this;
134
}
0 commit comments