I try like this :
@for($i = 0; $i < 5; $i++)
...
<div class="image ($i==0) ? 'image-main' : ''">
...
@endfor
But it does not work.
It seems the way of writing is incorrect.
How can I solve this problem?
I try like this :
@for($i = 0; $i < 5; $i++)
...
<div class="image ($i==0) ? 'image-main' : ''">
...
@endfor
But it does not work.
It seems the way of writing is incorrect.
How can I solve this problem?
In laravel's blade file you need to use {{}}
to execute php code.
{{ ($i == 0) ? 'image-main' : '' }}