Get Children only when count is > 0 #280
Unanswered
ElisameAraujo
asked this question in
Q&A
Replies: 1 comment 4 replies
-
Hi @ElisameAraujo, public function categoriasProdutos(){
return CategoriasProdutos::tree()->has('produtos')->get()->toTree()->skip(1);
} |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have been trying unsuccessfully for now to search only for subcategories that have products attached to them.
Basically I just want the
->children
method to bring the subcategories that have some product in a filter list of products by subcategory, how could I do this kind of thing?Produtos (Model)
CategoriasProdutos (Model)
LojaRepository.php
menu-lateral.blade.php
Beta Was this translation helpful? Give feedback.
All reactions