public function directionFromRelation(Relationship $relation, Model $parent, Model $related)
    {
        // We will match the ids of the parent model and the start node of the relationship
        // and if they match we know that the direction is outgoing, incoming otherwise.
        $node = $relation->getStartNode();

        // We will start by considering the relationship direction to be 'incoming' until
        // we match and find otherwise.
        $direction = 'in';

        if ($node->getId() === $parent->getKey())
        {
            $direction = 'out';
        }

        return $direction;
    }