I want help with saving multiple data to same database. So here is the thing, I have a form which is structure in table form and i have a button to add more form input of same type in it using JQuery.
So below is the basic structural idea of what i have:-
"Select Option" "Select Option 2" "Input Field"
"Select Option" "Select Option 2" "Input Field"
"Add More Button"
"Save Data Button"
Now if i click add more button another row having : "Select Option" "Select Option 2" "Input Field"
gets generated.
So what i want is when i click save data button. Each row gets saved in database with different id for each row.
so in case of two rows in form i want to bind the "Select Option"+"Select Option 2"+"Input Field" Values in one and save them in three different columns and then save the second row similarly on a different row in database and similarly for all the rows generated using JQuery.
I found it hard to explain my situation i hope the above briefing helps a little in understanding my problem.
I want to save them using Laravel Eloquent.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire