title: Laravel 4 adding numbers from foreach loop when count variable is supplied?
body: <p>I am passing the array $cats to my laravel template view. It is a multidimensional array from a database transaction, containing category data. So it would contain data like:</p>
  
  <pre><code>$cat[0]['id'] = 1;
  $cat[0]['name'] = 'First Category';
  </code></pre>
  
  <p>And so on. In my blade template I have the following code:</p>
  
  <pre><code>            {{ $i=0 }}
              @foreach($cats as $cat)
  
                      {{ $cat['name'] }}&lt;br /&gt;
  
                  {{ $i++ }}
  
              @endforeach
  </code></pre>
  
  <p>Which outputs:</p>
  
  <pre><code>0 First Category
  1 Second Category
  2 Third Category
  </code></pre>
  
  <p>Notice the numbers preceding the category name. Where are they coming from? Is this some clever Laravel trick? It seems that when you include a counter variable, they are automatically added. I can't find any mention of it anywhere, and I don't want them! How do I get rid of them?</p>
  
  <p>Thanks.</p>