syntax error, unexpected ')', expecting '[' (View: C:projectlaravelproject1app esourcesviewsproducts.blade.php)
one text
Solution:
The variables on PHP start with a $
sign. The $products
and $product
are variables so try to fix your code like this:
<ul>
@foreach ($products as $product)
<li>{{ $product->name }}</li>
@endforeach
</ul>
Please check the Laravel templating docs
Source