@php // Count total marketing initiatives from BOTH arrays $marketingCount = count($ArrlistingArticlespinitsponser ?? []) + count($ArrlistingArticlespinitsponser2 ?? []); // Defaults $boxHeight = '500px'; $showAd = false; switch ($marketingCount) { case 0: $boxHeight = '525px'; $showAd = true; break; case 1: $boxHeight = '660px'; break; case 2: $boxHeight = '635px'; break; case 3: $boxHeight = '460px'; break; default: $boxHeight = '420px'; break; } @endphp