Commit ebf5a383 authored by Ben Argo's avatar Ben Argo

Reaffirm support for BelongsToMany relations

This temporarily skirts around the issue described in the following issue: https://github.com/jenssegers/laravel-mongodb/issues/1293
parent 9e4786cc
......@@ -112,7 +112,11 @@ trait QueriesRelationships
return $relation->getForeignKey();
}
throw new \Exception(class_basename($relation) . ' Is Not supported for hybrid query constraints!');
if ($relation instanceof BelongsToMany && ! $this->isAcrossConnections($relation)) {
return $this->model->getKeyName();
}
throw new \Exception(class_basename($relation) . ' is not supported for hybrid query constraints.');
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment