protected function nestWheresForScope(QueryBuilder $query, $originalWhereCount)
{
// Here, we totally remove all of the where clauses since we are going to
// rebuild them as nested queries by slicing the groups of wheres into
// their own sections. This is to prevent any confusing logic order.
$allWheres = $query->wheres;
$query->wheres = [];
$this->addNestedWhereSlice($query, $allWheres, 0, $originalWhereCount);
$this->addNestedWhereSlice($query, $allWheres, $originalWhereCount);
}