public function get(Model $parent, Model $related, $type = [])
    {
        // Get the relationships for the parent node of the given type.
        $relationships = $this->getModelRelationsForType($parent, $type);

        $edges = [];
        // Collect the edges out of the found relationships.
        foreach ($relationships as $relationship)
        {
            // We need the direction so that we can generate an Edge[In|Out] instance accordingly.
            $direction = $this->directionFromRelation($relationship, $parent, $related);
            // Now that we have the direction and the relationship all we need to do is generate the edge
            // and add it to our collection of edges.
            $edges[] = $this->edgeFromRelationWithDirection($relationship, $parent, $related, $direction);
        }

        return new Collection($edges);
    }
public function get(Model $parent, Model $related, $type = [])
    {
        // Get the relationships for the parent node of the given type.
        $relationships = $this->getModelRelationsForType($parent, $type);

        $edges = [];
        // Collect the edges out of the found relationships.
        foreach ($relationships as $relationship)
        {
            // We need the direction so that we can generate an Edge[In|Out] instance accordingly.
            $direction = $this->directionFromRelation($relationship, $parent, $related);
            // Now that we have the direction and the relationship all we need to do is generate the edge
            // and add it to our collection of edges.
            $edges[] = $this->edgeFromRelationWithDirection($relationship, $parent, $related, $direction);
        }

        return new Collection($edges);
    }
public function get ( Model $ parent , Model $ related , $ type = [ ] ) { // Get the relationships for the parent node of the given type. $ relationships = $ this -> getModelRelationsForType ( $ parent , $ type ) ; $ edges = [ ] ; // Collect the edges out of the found relationships. foreach ( $ relationships as $ relationship ) { // We need the direction so that we can generate an Edge[In|Out] instance accordingly. $ direction = $ this -> directionFromRelation ( $ relationship , $ parent , $ related ) ; // Now that we have the direction and the relationship all we need to do is generate the edge // and add it to our collection of edges. $ edges [ ] = $ this -> edgeFromRelationWithDirection ( $ relationship , $ parent , $ related , $ direction ) ; } return new Collection ( $ edges ) ; }
Get the edges between two models.

@param  \Vinelab\NeoEloquent\Eloquent\Model  $parent
@param  \Vinelab\NeoEloquent\Eloquent\Model  $related
@param  string|array $type
@return \Illuminate\Database\Eloquent\Collection
Get the edges between two models .