title: How can limited span class item list in Laravel
body: <p>Limit to item list:
  <a href="https://i.stack.imgur.com/3ww75.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3ww75.png" alt="Limit to item list" /></a></p>
  <p>More Description from the Pics:
  <a href="https://i.stack.imgur.com/54Zmp.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/54Zmp.jpg" alt="More Description from the Pics" /></a></p>
  <p>I want to limited max item list at Laravel, As you if select all filter in admin panel, its look like this. So how can limited first 5 item to popular filters ?</p>
  <pre><code> &lt;div class=&quot;g-attributes&quot;&gt;
                  &lt;span class=&quot;attr-title&quot; style=&quot;color: orange&quot;&gt;&lt;b&gt;&lt;i class=&quot;icofont-medal&quot;&gt;&lt;/i&gt; {{$translate_attribute-&gt;name ?? &quot;&quot;}}:&lt;/b&gt; &lt;/span&gt;
                  @foreach($termsByAttribute as $term )
                      @php $translate_term = $term-&gt;translateOrOrigin(app()-&gt;getLocale()) @endphp
                      &lt;span class=&quot;item {{$term-&gt;slug}} term-{{$term-&gt;id}}&quot; style=&quot;color: green&quot; &gt;{{$translate_term-&gt;name}}&lt;/span&gt;
                  @endforeach
              &lt;/div&gt;
  </code></pre>