array_merge(): Argument #2 is not an array laravel 4
How can i properly loop this
If i tick one checkbox, it works properly, but if i tick more than 1, not
even one will be updated.
array_merge(): Argument #2 is not an array laravel 4
(Caused by array_merge(): Argument #2 is not an array)
Controller
if (Input::has('orderIds'))
{
**foreach(Input::get('orderIds') as $orderid)**{
Order::whereIn('id', $orderid)->update(array('top_up_id' =>
$topUp->id));
}
}
javascript
$('#top-up-pending-payment-table tbody
input:checkbox:checked').each(function(){
orderIdsHtml += '<input type="hidden" name="orderIds[]" value="' +
$(this).data('id') + '">';
});
Debug Post Data
orderIds Array ( [0] => 79 [1] => 80 )
No comments:
Post a Comment