etrepat / baum

Baum is an implementation of the Nested Set pattern for Laravel's Eloquent ORM.
http://etrepat.com/baum
MIT License
2.24k stars 459 forks source link

getNestedList() filter by depth #298

Open saraMoradi07 opened 6 years ago

saraMoradi07 commented 6 years ago

I use $products=Product::getNestedList('title',null,'--'); in my controller .but this return all category with each depth, I want show just depth<=2 ,i try to use $products=Product::getNestedList('title',null,'--')->limitDepth(2); and $products=Product::getNestedList('title',null,'--')->getDescendants(2); and $products=Product::where('depth','<=',2)->getNestedList('title',null,'--'); but not work . how can i filter with depth ?