Post Form Jquery Repeteable + Laravel

I need your help.

I have a form with some fields generated with Jquery Repeteable. In other words, I have fields with a similar name.

Now, in Laravel I need it once sent to be able to manipulate this information to generate an array

This is the code

        <div class="form-group col-md-3" hidden>
        <input type="text" class="span6 form-control" name="id[{?}]" value="{?}" id="id_{?}">
        </div>
        <div class="form-group col-md-3">
        <input type="text" class="span6 form-control" name="umed[{?}]" value="{umed}" id="umed{?}">
        </div>
        <div class="form-group col-md-3">
        <input type="text" class="span2 form-control" name="cant[{?}]" value="{cant}" id="cant{?}">
        </div>

In the controller i need this

        $sub_items = array(
        "txtITEM"                   => $request->id[],
        "txtUMED"                   => $request->umed[],
        "txtCANT"                   => $request->cant[],
    );

I know that i need a foreach but i dont know how, please i need your help



Read more here: https://stackoverflow.com/questions/64894367/post-form-jquery-repeteable-laravel

Content Attribution

This content was originally published by Lembes at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: