Open andgith opened 3 years ago
Thanks for the info, I'm trying to eager load the ancestors for a collection of nodes in the correct order.
Category::with('ancestors')->paginate(30);
Does not order the eager loaded ancestors.
$result = Category::defaultOrder()->ancestorsOf($id);
Cannot be used to eager load.
I can apply defaultOrder()
to the relation manually .
Category::with(['ancestors' => function ($q) {
$q->defaultOrder();
}])->get()
Hi, thanks for this package, I think the default order was meant to be the default, without having to put that ->defaultOrder()
. Are there any case when it doesn't? @lazychaser
I have noticed the the getAncestors method on a node seems to give the ancestors in the order they were created.
Is this behaviour intended? I was wanting to use this info to generate breadcrumbs.
Version: v5.0.5
See example output from getAncestors():