diff --git a/src/Core/Post/RegisteredTypesScope.php b/src/Core/Post/RegisteredTypesScope.php index 35dd977e8..e0cf51707 100644 --- a/src/Core/Post/RegisteredTypesScope.php +++ b/src/Core/Post/RegisteredTypesScope.php @@ -49,7 +49,7 @@ class RegisteredTypesScope implements ScopeInterface { $query = $builder->getQuery(); - $this->whereIndex = count($query->wheres); + $this->whereIndex = count($query->wheres ?: []); $this->bindingIndex = count($query->getRawBindings()['where']); $types = array_keys($post::getModels());