protected function nestedRelations($relation)
{
$nested = array();
// We are basically looking for any relationships that are nested deeper than
// the given top-level relationship. We will just check for any relations
// that start with the given top relations and adds them to our arrays.
foreach ($this->eagerLoad as $name => $constraints) {
if ($this->isNested($name, $relation)) {
$nested[substr($name, strlen($relation . '.'))] = $constraints;
}
}
return $nested;
}