title: Laravel Set tab active in foreach
body: <p>how do i set a tab page class 'active' in a dynamical created list? </p>
  
  <p>i have a link 'toon alle' where i show all my records, but when ik click a link i display a different view. but the active tab remains on my first link.</p>
  
  <pre><code>&lt;ul class="nav nav-pills sort-source" data-sort-id="portfolio" data-option-key="filter"&gt;
      &lt;li data-option-value="*" class="active"&gt;
          &lt;a href="#" ng-click="getAllRequests(1)"&gt;Toon alle&lt;/a&gt;
      &lt;/li&gt;
      @foreach ($Categories as $categorie)
          &lt;li data-option-value=".{{$categorie-&gt;nameN}}" class=""&gt;
              &lt;a href="#" ng-click="getRequests({{$categorie-&gt;id}})"
                 data-id="{{$categorie-&gt;id}}"&gt;{{$categorie-&gt;nameN}}
              &lt;/a&gt;
          &lt;/li&gt;
      @endforeach
  &lt;/ul&gt;
  </code></pre>