I am using blade for the first time, and i need to change the styling of this div element depending on how many properties are available. I need to write an if statement which hides the div if equal or less than one and add a different class if equal to 2.
how would i write this using blade or php?
@if (isset($participatingProperties) && !empty($participatingProperties) && is_array($participatingProperties))
<?php $i = 0; ?>
@foreach ($participatingProperties as $key => $property)
@if ($i++ % 3 === 0)
<div class="item item2 {{ $i < 3 ? 'active' : '' }}">
@endif