I added custom class for the last row of grid with checking loop count
@forelse ( $activeAreaGuides as $activeAreaGuide ) < div class = "col-xl-4 col-md-6" > < div class = "th-team team-grid {{ $loop -> remaining < ( $loop -> count % 3 == 0 ? 3 : $loop -> count % 3 ) ? 'custom-margin-last-row' : 'custom-margin-team-grid' }} " > < div class = "team-img2" > < img src = " {{ env ('FILESYSTEM_URL') . $activeAreaGuide -> photograph }} " > </ div > < div class = "team-content" > < div class = "media-body" > ...