Skip to content

Eager load descendants? #45

Closed
Closed
@dmaksimov

Description

@dmaksimov

Is there any way to eager load descendants without having to iterate through each node?

Right now I'm having to do

foreach ($nodes as $node) {
    $node->getDescendants();
}

It would be nice to do something like

$categories = Category::with('descendants')->get();

and the each category would have $category->descendants.

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