title: Laravel a foreach loop to fill out a form
body: <p>I created a form and filled out most of the fields with data from my db using a foreach loop for fill out several rows.  The problem I am having is how to submit just one row of information to my controller.  As of now the form always submits the last row of data.  So if I submit the second row the data that gets sent to my controller is the information from the last row.  What can I do so when I click on the button for the second row, I get sent the info for my second row to my controller.</p>
  
  <p>Here is my form code</p>
  
  <pre><code>&lt;form action="/jadmin/updatebulkexpirationdate" method="post"&gt;
          @foreach ($users as $user)
              &lt;tr&gt;
                  &lt;td id="name" value="{{$user-&gt;domain}}"&gt;{{ $user-&gt;domain}}&lt;/td&gt;
                  &lt;input type="hidden" name="domain" value="{{$user-&gt;domain}}"&gt;
                  &lt;td&gt;{{ $user-&gt;where('plan_expiration', $user-&gt;plan_expiration)-&gt;where('domain', $user-&gt;domain)-&gt;count()}}&lt;/td&gt;
                  &lt;td id="oldDate&gt;{{ $user-&gt;plan_expiration }}&lt;/td&gt;
                  &lt;input type="hidden" name="oldDate" value="{{$user-&gt;plan_expiration}}"&gt;
                  &lt;td&gt;&lt;button class="btn btn-default" id="newBulkExpiratioDateUpdate" type="submit"&gt;Set New Expiration Date&lt;/button&gt;&lt;/td&gt;
              &lt;/tr&gt;
          @endforeach
          &lt;/form&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/0Nn0u.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0Nn0u.png" alt="enter image description here"></a></p>