mardi 17 janvier 2017

How to save dynamic data in database in laravel

My project is on angularjs+Laravel.

From frontend I am sending dynamically generated input to laravel controller.

Scenario is I am taking family details where child field is dynamic.So if you click of Add more It will generate another input field.

Initially Person X have 1 child namely ROohan . Now he Have 2 more, Now when he is sending data of 3 new children, I want that 2 children data get added without over writing present 2 children.

My request which I am receiving in controller

family_data : 
      {"famdet":[{"id":"choice1","cname":"Rohan","doa":"2017-01-12"},  
       {"id":"choice2","cname":"sohan","cdob":"2017-01-13"},           
       {"id":"choice3","cname":"nitesh","cdob":"2017-01-07"}
          ]}

my problem is How to make this data save in separate row and if data is present then row should not be get created.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2k1ahyn
via IFTTT

Aucun commentaire:

Enregistrer un commentaire