php - laravel 5.4 use where in blade template -
what correct syntax write code in laravel 5.4
@foreach($productchuck $product $product->category_id = 1)
//some date section @endforeach
all want display product has category_id of 1
thanks in advance
the correct syntax be:
@foreach($productchuck->where('category_id', 1) $product) .... @endforeach
assuming $productchuck
collection. see this more information.
Comments
Post a Comment