Return a query that includes pivot data for belongsToMany relations
This commit is contained in:
parent
81d0225928
commit
ce77c0f89e
|
|
@ -969,6 +969,11 @@ class RelationController extends ControllerBehavior
|
|||
elseif ($this->model->exists) {
|
||||
$this->relationObject->addConstraints();
|
||||
}
|
||||
|
||||
if ($this->relationType == 'belongsToMany') {
|
||||
$this->relationObject->setQuery($query->getQuery());
|
||||
return $this->relationObject;
|
||||
}
|
||||
});
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in New Issue