title: Getting 2 accordion headings instead of 1
body: <p>I'm trying to create an accordion type of menu. What I have at the moment is a column in the database that looks like
  <code>menu 1/sub menu 1</code> and in my function I explode that to create an array that looks something like:</p>
  <pre><code>array:2 [▼
    0 =&gt; &quot;menu 1&quot;
    1 =&gt; &quot;sub menu 1&quot;
  ]
  </code></pre>
  <p>At the moment I'm not sure how to add the sub menu inside the accordion.</p>
  <p>This is what I have at the moment:</p>
  <pre class="lang-html prettyprint-override"><code>@foreach($m['explode'] as $k =&gt; $m)
      &lt;div class=&quot;card-header&quot; id=&quot;headingTwo&quot;&gt;
          &lt;h2 class=&quot;mb-0&quot;&gt;
              &lt;button class=&quot;btn btn-link btn-block text-left&quot; type=&quot;button&quot; data-toggle=&quot;collapse&quot; data-target=&quot;#{{ $m }}&quot; aria-expanded=&quot;true&quot; aria-controls=&quot;collapseOne&quot;&gt;
                  {{ $m }}
              &lt;/button&gt;
          &lt;/h2&gt;
      &lt;/div&gt;
  
      &lt;div id=&quot;{{ $m }}&quot; class=&quot;collapse show&quot; aria-labelledby=&quot;headingOne&quot; data-parent=&quot;#accordionExample&quot;&gt;
          &lt;div class=&quot;card-body&quot;&gt;
              {{ $m }}
          &lt;/div&gt;
      &lt;/div&gt;
  @endforeach
  </code></pre>
  <p>What happens is that I get 2 accordion headings instead of 1. It's also possible to have more than 2 items in an array.</p>