I am using Ajax POST method with Laravel Api, whenever I click submit it shows "500 internal server error" and in Laravel, it shows the "GET method not allowed for this route. Supported method POST".

Actually, when I use this Ajax method with this type of array `{"status":0,"product_id":"62","company":"Whitel","orignal_qty":"8"}` **It Works**.

But in this case, the array contains more than one object. I need to use Loop in Laravel Controller but I don't know how to handle multiple array objects.

Here is my code...

`var myArrJSON = [{"status":0,"product_id":"62","company":"Whitel","orignal_qty":"8"},{"status":0,"product_id":"55","company":"Wow","orignal_qty":"9"}]`

```
$.ajax({
  type:"POST",
  url: "http://localhost/spe-api/public/api/net/store",
  headers: {
    'Accept': 'application/json',
    'Content-Type': 'application/json'
  },
  data: myArrJSON,
  success:function(response){
    alert('success');
  },
  error:function(response){ 
    alert('error');
  }
});

```

Here is Laravel code...

`Route::post('/net/store', 'NetController@netStoreData');`

```
public function netStoreData(Request $request, Net $net) {
  $data = [];
  $data = $request->all();
  foreach($data->values as $item) {
    $data['status'] = $item->status;
    $data['product_id'] = $item->product_id;
    $data['company'] = $item->company;
    $data['quantity'] = $item->orignal_qty;

    $net->insert($data);
  }
}

```