Laravel - Why my code isnt displaying all the collapses ?
Laravel - Why my code isnt displaying all the collapses ?
This code need to display all "subcategory" for each "subcategories"
But the view result is the first subcategory only.
Where i missed please ?
View 1 :
@foreach($treeView as $category)
<div class="collapse multi-collapse collapse in " id="8" >
<div class="col-md-2"> $category->account_name</div>
<div class=" float-right"><button class="btn btn-success" data-toggle="collapse" data-target="# $category->id8" aria-expanded="false" aria-controls=" $category->id8" @click="getSubaccount(); getNumberrawaccount();">
<span class="glyphicon glyphicon-eye-open"></span></button></div>
<br>
<div class="list-group">
@if(count($category->subcategories))
@include('tree2',['subcategories'=>$category->subcategories])
@endif
</div>
@endforeach
View 2 : tree2
<div class='list-group'>
<br>
@foreach($subcategories as $subcategory)
<div class="list-group col-md-12">
<div class="collapse multi-collapse" id=" $category->id8" >
<div class="col-md-4"> $subcategory->subaccount_name </div>
<div class=" float-right"><button class="btn btn-success" data-toggle="collapse" data-target="# $subcategory->id" aria-expanded="false" aria-controls="collapseExample2">
<span class="glyphicon glyphicon-eye-open"></span></button></div>
</div>
</div>
@endforeach
</div>
Thank you
array
$category->subcategories
Yes, but shows only the first result, not all of them. When i use collapse in in my class, it does.
– Yassine Jennane
Sep 2 at 16:27
Thanks for contributing an answer to Stack Overflow!
But avoid …
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
But avoid …
To learn more, see our tips on writing great answers.
Required, but never shown
Required, but never shown
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
this return with
array
$category->subcategories
??– Alexander Villalobos
Sep 2 at 15:27