I have an array $cart:
array:1 [
"product" => array:5 [
"product_id" => array:2 [
0 => 2
1 =>
I would reformat the input like this but what you need is @foreach($products as $product)
$products
being whatever your current variable is.
If you dont want to change the format of the input (really, I recommend it) use Alexey Mezenin's answer
$products = [
['id' => '2',
'name' => 'HP Core i3 5th Gen - (4 GB/1 TB HDD/DOS) X5Q17PA 15-be005TU Notebook (15.6 inch, Turbo SIlver, 2.19 kg)',
'description' => 'SAMSUNG 55.88cm (22) Full HD LED TV (UA22F5100AR, 2 x HDMI, 2 x USB)',
'image' => '1481116344.jpeg',
'price' => '350',
],
['id' => '6',
'name' => 'HP Core i3 5th Gen - (4 GB/1 TB HDD/DOS) X5Q17PA 15-be005TU Notebook (15.6 inch, Turbo SIlver, 2.19 kg)HP Core i3 5th Gen - (4 GB/1 TB HDD/DOS) X5Q17PA 15-be005TU Notebook (15.6 inch, Turbo SIlver, 2.19 kg)',
'description' => 'SAMSUNG 55.88cm (22) Full HD LED TV (UA22F5100AR, 2 x HDMI, 2 x USB)',
'image' => '1481116344.jpeg',
'price' => '200',
]
];
@foreach($products as $product)
{{$product['name']}}
{{$product['description']}}
${{$product['price']}} x
@endforeach