Form inside a foreach loop not working properly
<p>I'm creating a testing blog site in laravel 5.2 and trying to create a page to manage all the categories.
So far everything is working fine, but I'd like to have a table with a list of the categories and edit each one inline. Usually I create a table and a foreach loop inside it with a form for every row, but this time it's not working properly. I read around that the form inside a table is a bad practice, so I tried to make it just with divs, but it doesn't work either.</p>

<p>Here is the code of the view:</p>

<pre><code>@foreach($categories as $category)
 &lt;form action="/blog/categories/edit/{{ $category-&gt;id }}" method="post"&gt;
  &lt;div class="row"&gt;
   &lt;input type="hidden" name="_token" value="{{ csrf_token() }}"&gt;
   &lt;div class="col-md-2"&gt;&lt;input type="text" value="{{ $category-&gt;id }}" name="id" class="category-input-id" readonly="readonly"&gt;&lt;/div&gt;
   &lt;div class="col-md-2"&gt;{{ $category-&gt;created_at }}&lt;/div&gt;
   &lt;div class="col-md-2"&gt;{{ $category-&gt;updated_at }}&lt;/div&gt;
   &lt;div class="col-md-2"&gt;
    &lt;label for"edit" class="btn btn-primary"&gt;&lt;i class="fa fa-pancil"&gt;&lt;/i&gt;&lt;/label&gt;
    &lt;input type="submit" id="edit" name="edit" class="hidden" /&gt;
    &lt;label for="delete" class="btn btn-danger"&gt;&lt;i class="fa fa-trash"&gt;&lt;/i&gt;&lt;/label&gt;
    &lt;input type="submit" id="delete" name="delete" class="hidden" /&gt;
   &lt;/div&gt;
 &lt;/div&gt;
&lt;/form&gt;
@endforeach
</code></pre>

<p>In the controller:</p>

<pre><code>public function editcategory (Request $request, $id)
{

    dd($request-&gt;all());
}
</code></pre>

<p>I didn't paste all the code to get the datas because I don't receive the right datas here.</p>

<p>The output is only the first row in the loop!
Whenever I click, it only gets the first element.</p>

<pre><code>array:5 [▼
  "_token" =&gt; "wUhnsw8AoAuUDsuElALg8nM91bFG4EkUHTEAkkjp"
  "id" =&gt; "16"
  "name" =&gt; "Category Name"
  "description" =&gt; "desc test"
  "edit" =&gt; "Send"
]
</code></pre>

<p>Where I go wrong ? 
I also tried to put the form outside the loop and use arrays for the elements (like name="description[]" etc.. ) but I don't know how to get the right one once I pass all the arrays !</p>

<p>Thanks</p>