Answer the question
In order to leave comments, you need to log in
How to check variable value in laravel 7?
If the array is not empty then it works, if it is empty it gives an error.
@if (count($products))
@foreach ($products as $product)
<tr><td> {{ $product->kod }}</td><td> {{ $product->price }}</td>< <td> {{ $product->kod }}<td></td></tr>
@endforeach
{{ $products->links() }}
@else
I don't have any records!
@endif
Answer the question
In order to leave comments, you need to log in
@if(! empty($products))
@foreach ($products as $product)
{{ $product->kod }} {{ $product->price }}< {{ $product->kod }}
@endforeach
{{ $products->links() }}
@else
I don't have any records!
@endif
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question