Closed sbc640964 closed 2 years ago
hasManyDeepFromRelations()
does not yet apply constraints, you need to add them manually for now:
return hasManyDeepFromRelations(
$this->records(),
(new Record())->data()
)->where(...);
@staudenmeir Thanks. Too bad, why not really?
It's quite complex to cover all the possible cases, but I'm working on it.
I released v1.15.3
with hasManyDeepFromRelationsWithConstraints()
:
return $this->hasManyDeepFromRelationsWithConstraints(
[$this, 'records'],
[new Record(), 'data']
);
I have two functions that return relationship - 1:records 2:data For the first time I added wheres inside the function
When I use with hasManyDeepFromRelations I get a query that does not include the queries of the records function: