Laravel-mongodb: Call to undefined method Jenssegers\Mongodb\Query\Builder::getHasCompareKey()

Created on 9 Feb 2016  路  5Comments  路  Source: jenssegers/laravel-mongodb

After doing composer update to have the fix for wrap() mentioned in #729 I'm getting this error:

BadMethodCallException in Builder.php line 2093:
Call to undefined method JenssegersMongodbQueryBuilder::getHasCompareKey()

What I'm trying to do is this:

$query->whereHas('category', function($subq) use($search_term) {
                      $subq->where('title', 'like', '%'.$search_term.'%');
});

My current version is v2.3.2

Most helpful comment

Call to undefined method MoloquentQueryBuilder::getHasCompareKey()
having the same issue, and still not finding the answer..

All 5 comments

My little investigation mentioned in #729:

Implementation of \Jenssegers\Mongodb\Eloquent\Builder::addHasWhere has call to $relation->getHasCompareKey(), where $relation is instance of \Jenssegers\Mongodb\Relations\BelongsTo.

Take into account, that parent implementation of this method (\Illuminate\Database\Eloquent\Builder::addHasWhere) _doesn't_ have call to getHasCompareKey and that's why works.
So, it's still not possible to use static::whereHas like original one.

any solution for this ?

Call to undefined method MoloquentQueryBuilder::getHasCompareKey()
having the same issue, and still not finding the answer..

Same issue :(

yes i same.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

HassanIbrahim picture HassanIbrahim  路  3Comments

sebastiaanluca picture sebastiaanluca  路  3Comments

imrannazirbhat picture imrannazirbhat  路  3Comments

geofflancaster picture geofflancaster  路  3Comments

yupangestu picture yupangestu  路  3Comments