Skip to content
Advertisement

Laravel multiple foreach for inserting data into database [closed]

I have a table with form input inside it. Whenever I click the submit button, it will save all of the data into the database like this.
enter image description here

What should I do inside my Laravel Controller? Thanks in advance. Here’s my code example

UPDATE Result:

enter image description here

UPDATE HTML Form Input:

JavaScript

UPDATE Controller:

JavaScript

Advertisement

Answer

Not sure from where date will get but for other data first change form design

JavaScript

and in controller

JavaScript

and for insert to database

JavaScript

Updated

You can do somethink like below for each date

JavaScript

and in controller

JavaScript

Update2

JavaScript

and in controller

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement