Я хочу отправить мультиданные (блэйд прилагается ниже) в API веб-сервисов, поэтому я установлю флажок и нажму назначить кнопку для отправки данных веб-сервису.
<table id="dt_basic" class="table table-striped table-bordered table-hover" width="100%">
<thead>
<tr>
<th>No.</th>
<th>IC Number</th>
<th>Name</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>abc</td>
<td>abc</td>
<td> <input type="checkbox" id="basic_checkbox_"
name="CustIDNo[]">
</td>
</tr>
<tr>
<td>1</td>
<td>abc</td>
<td>abc</td>
<td> <input type="checkbox" id="basic_checkbox_"
name="CustIDNo[]">
</td>
</tr>
</tbody>
</table>
<div class="col-md-2 col-md-offset-10">
<button class="btn btn-sm btn-success" onclick="thanks()" type="submit" ><i class="material-icons">Assign</button>
</div>
вот мой контроллер
public function send(Request $request)
{
$client = new Client();
$item = array_map(null, $request->CustIDNo, $request->id_cus, $request->ic, $request->ci);
foreach($item as $val) {
$antiattrition = AntiAttrition::where('CustIDNo',$val[0])->limit('1')->first();
$res = $client->request('POST', 'http://localhost/mom/public/api/xxxx',
[
'headers' => [
'Accept' => 'application/json',
'Authorization' => 'Bearer'
],
'form_params' => [
'mo_id' => $antiattrition->mo_id,
'id_clrt' => $antiattrition->id,
'TaskID' => $antiattrition->TaskID,
'ACID' => $antiattrition->ACID
]
]);
}
$array = json_decode($res->getBody()->getContents(), true);
dd($array);
}
проблема в том, что только первые данные, полученные веб-службами, как разместить все данные? Я использую Laravel и жрать