I'm creating an app using Laravel(API) and AngularJS. I have a store and cart using the library ng-cart. Every time I add an item to the cart, it adds to the cart object of an instance. In my database, I have three tables: item
,orders
,item_order
. According to Laravel, I have to use the append command to append multiple items to an order on the item_order
table. However, I do not know how many items I will send to the database.
My problem is, how do I pass an unknown number of variables from the scope to the database table item_order
? Or more specifically, how to pass those variables from the front-end to API and how to handle that data on the API side?
Any ideas?