vendredi 25 novembre 2016

How to get the key from a laravel form request?

I have an array

array:2 [▼
  2 => "12"
  7 => "12"
]

Send from a form, I need the 2 and 7 how do i call them?

The keys are id's of parts so want to. foreach get the ID and value then update something...

foreach($request->except('_token') as $part) {

        get Key here (in this case 2 or 7) and get value here (in this case both 12)

    }

Can somebody tell me how to do this?

Thanks in advance.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire