i have a code that stores my data in a database. but everytime it stores in the database, it only gets the last data and not the whole data from my increment.
 $('#btnSubmit').on('click', function(){
    for(var increment = 0; increment <= pos_inc; increment++){
        var text1 = $('#id_item'+increment).val();
        var text2 = parseInt($('#item_quan'+increment).val()); 
        var text3 = $('#price_tot'+increment).val();
        var text4 = $('#or').val();
        var text5 = $('#cus_name').val();
        var text6 = $('#total').val();
        var text7 = parseInt([$('#id_categ'+increment).val()]);
        $.post('DoAddSales', {
            '_token': $('input[name=_token]').val(),
            'orders': text1,
            'item_quan': text2, 
            'price_tot': text3,
            'or': text4,
            'cus_name': text5,
            'total': text6,
            'id_categ': text7,
         },function(data){
            window.location.href = "use-pos";
         });
    }
});
in my controller i have the following:
$inc = $request->input('inc');   
$inc2 = 1;
for($inc2; $inc2 <= $inc; $inc2++){
    $ix = ($request->input('i_name'.$inc2));
    $ix2 = ($request->input('quan'.$inc2));  
    $ix3 = ($request->input('tot'.$inc2));
    $ix4 = ($request->input('id_categ'.$inc2));
    $ix5 = ($request->input('id_item'.$inc2));
    echo '<input type="hidden" name="orders'.$inc2.'" id="orders'.$inc2.'" class="getOrders" value="'.$ix.'" disabled>'; 
    echo '<input type="hidden" name="item_quan'.$inc2.'" id="item_quan'.$inc2.'" class="getOrders" value="'.$ix2.'" disabled>';
    echo '<input type="hidden" name="price_tot'.$inc2.'" id="price_tot'.$inc2.'" class="getOrders" value="'.$ix3.'" disabled>';
    echo '<input type="hidden" name="id_categ'.$inc2.'" id="id_categ'.$inc2.'" class="getOrders" value="'.$ix4.'" disabled>';
    echo '<input type="hidden" name="id_item'.$inc2.'" id="id_item'.$inc2.'" class="getOrders" value="'.$ix5.'" disabled>';                   
}  
echo '<input type="hidden" id="inc" value="'.$inc.'" disabled>';
return view('show_sales')->with(
    array('name'=>$request->input('customer_name'),
        'or_no'=>$request->input('or_number'),          
        'total'=>$request->input('samp'),            
        'change'=>$request->input('change'),
        'inc'=>$inc,
    ));
i am still new to AJAX and Laravel, and is still learning, how can i output all the data with the increments from the inputs and save it in the database?


