Closed azulkipli closed 9 years ago
Hi, Thanks for creating this package.
I use this package for dynamic hierarchy Menu Item.
Currently I use this method to check if node has child ;
if (count($node->children()->get()) > 0 ) if (count($node->getDescendants()) > 0 )
When I am doing this method, this is running query as many as node in the loop.
Any other best method to check if node has child without query to database, such as isRoot(), isLeaf() ?
Thanks
You could definitely use isLeaf() here. https://github.com/etrepat/baum#node-questions
isLeaf()
Oh I think I miss this line, thanks
isLeaf(): Returns true if this is a leaf node (end of a branch).
Hi, Thanks for creating this package.
I use this package for dynamic hierarchy Menu Item.
Currently I use this method to check if node has child ;
When I am doing this method, this is running query as many as node in the loop.
Any other best method to check if node has child without query to database, such as isRoot(), isLeaf() ?
Thanks