public function whereRelatedHas($relationship, $constraint, $depth = 0)
	{
		$rel  = $this->$relationship();
		$keys = $rel->getConstrainedKeys($constraint);

		return $this->where($rel->getLocalKey(), 'IN', $keys, 'and', $depth);
	}
public function whereRelatedHas($relationship, $constraint, $depth = 0)
	{
		$rel  = $this->$relationship();
		$keys = $rel->getConstrainedKeys($constraint);

		return $this->where($rel->getLocalKey(), 'IN', $keys, 'and', $depth);
	}
public function whereRelatedHas ( $ relationship , $ constraint , $ depth = 0 ) { $ rel = $ this -> $ relationship ( ) ; $ keys = $ rel -> getConstrainedKeys ( $ constraint ) ; return $ this -> where ( $ rel -> getLocalKey ( ) , 'IN' , $ keys , 'and' , $ depth ) ; }
Selects applicable rows on the relation and limits current query accordingly

NOTE: whereas other 'where' clauses can be called statically due to their
location in the query builder class, this method cannot be as it is attached
directly to the model itself.

@param   string   $relationship  The relationship name
@param   closure  $constraint    The constraint to apply to the related query
@param   int      $depth         The depth level of the clause, for sub clauses
@return  $this
@since   2.0.0
Selects applicable rows on the relation and limits current query accordingly