Skip to content

Is there any way to use multiple tree on a single table? #313

@HazzazBinFaiz

Description

@HazzazBinFaiz

I wanted to implement two tree in a single table.
Table : users
First relation is parent
And second is introducer

The parent tree is working fine, but when I try to grab ancestors of introducer tree, it gives me parent tree result.

I am trying to pass the different foreign key name but got no luck.

public function introducerAncestors()
{
    return $this->newAncestors(
        (new static())->newQuery(),
        $this,
        (new static())->getTable().'.introducer_id',
        'id',
        false
    );
}

Is there any way to use multiple tree on same table?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions