samedi 23 septembre 2017

adding products in different column in laravel

Hi guys I want to add products in differents column in database, however all I have done it was inserting all products in same column. thanks

my code:

$products = $request->all();


foreach( $products as $product) {

$invoice->products([        
'name' => $product['name'],
'price' => $product['price'],
'qty' => $product['qty'],
'total' => $product['total']
]);
}   

results

database shot



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

Aucun commentaire:

Enregistrer un commentaire