title: Sending selected ids with one button with laravel checkbox
body: <p>There are id values ​​as in the photo below and I want to send them into a function, but in the examples I have examined, they are not sent with a single button, so since it is in the foreach, the button is constantly produced. How can I send the selected id values ​​with a single button?</p>
  <p><a href="https://i.stack.imgur.com/mVhXk.png" rel="nofollow noreferrer">ID's</a></p>
  <pre><code>&lt;div class=&quot;col-lg-4&quot;&gt;
  &lt;input id=&quot;tea-submit&quot; type=&quot;submit1&quot; class=&quot;btn btn-primary mt-35&quot; name=&quot;submit1&quot; value=&quot;Send&quot;&gt;
  &lt;/div&gt;
  
  
      @foreach ($pks as $pk)
       &lt;tr&gt;
       &lt;td class=&quot;text-center&quot;&gt;
       &lt;form action=&quot;{{route('admin.pks.calculate')}}&quot; method=&quot;POST&quot;&gt;
        @csrf
       &lt;input type=&quot;checkbox&quot; name=&quot;pk_id[]&quot; value=&quot;{{$pk-&gt;id}}&quot;&gt;
        &lt;/form&gt;
        {{ $pk-&gt;id }}
       &lt;/td&gt;
       &lt;/tr&gt;
      @endforeach
  
  public function calculate(Request $request)
      {
          $pk_ids = $request-&gt;input('pk_id');
          dd($pk_ids);
      }
  </code></pre>