Skip to content

Commit

Permalink
Rename getRelationQuery to getRelationExistenceQuery for Laravel 5.4 …
Browse files Browse the repository at this point in the history
…compatibility. Removed usage of moved wrap() method (#22)
  • Loading branch information
Yordi de Kleijn authored and znck committed Mar 27, 2017
1 parent 91fccbf commit b888044
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Relations/BelongsToThrough.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,11 @@ protected function setRelationQueryConstraints(Builder $query)
$one = $model->getQualifiedKeyName();
}

$key = $this->wrap($this->getQualifiedParentKeyName());
$key = $this->parent
->newQueryWithoutScopes()
->getQuery()
->getGrammar()
->wrap($this->getQualifiedParentKeyName());

$query->where(new Expression($alias.'.'.$this->getParent()->getKeyName()), '=', new Expression($key));
}
Expand All @@ -205,7 +209,7 @@ protected function setRelationQueryConstraints(Builder $query)
*
* @return \Illuminate\Database\Eloquent\Builder
*/
public function getRelationQuery(Builder $query, Builder $parent, $columns = ['*'])
public function getRelationExistenceQuery(Builder $query, Builder $parent, $columns = ['*'])
{
$query->select($columns);

Expand Down

0 comments on commit b888044

Please sign in to comment.