@php $limitcounter = 0; @endphp

@foreach ($episodes as $ep)
    @if (isset($popularView))
        @php $episode = $ep->episode @endphp
    @else
        @php $episode = $ep @endphp
    @endif

    @if ($limitcounter >= $limit)
        @break
    @endif

    <x-episode-thumbnail :episode="$episode" />

    @php $limitcounter++; @endphp
@endforeach
