title: How to get the key from a laravel form request?
body: <p>I have an array</p>
  
  <pre><code>array:2 [▼
    2 =&gt; "12"
    7 =&gt; "12"
  ]
  </code></pre>
  
  <p>Send from a form, I need the 2 and 7 how do i call them?</p>
  
  <p>The keys are id's of parts so want to. 
  foreach get the ID and value
  then update something...</p>
  
  <pre><code>foreach($request-&gt;except('_token') as $part) {
      /*get Key here (in this case 2 or 7) and get value here (in this case both 12)*/
  }
  </code></pre>
  
  <p>Can somebody tell me how to do this?</p>
  
  <p>Thanks in advance.</p>