public function filterUnjoinedRelation($related)
{
$this->query->whereHas($related, function ($q) use($related) {
$this->callRelatedLocalSetup($related, $q);
// If we defined it locally then we're running the closure on the related model here right.
foreach ($this->getLocalRelation($related) as $closure) {
// Run in context of the related model locally
$closure($q);
}
if (count($filterableRelated = $this->getRelatedFilterInput($related)) > 0) {
$q->filter($filterableRelated);
}
return $q;
});
}