@php $popular_songs = $data['landingpage']['popular_songs']; $popular_song = count($popular_songs); // $popular_song = 2; @endphp @if ($popular_song >= 3)
@foreach ($data['landingpage']['popular_songs'] ?? [] as $popular_songs)
{{ $popular_songs['song_title'] }}

{{ $popular_songs['songwriter_name'] }}

@php for ($i = 1; $i <= $popular_songs['total_rating']; $i++) { echo ' '; } @endphp

Dipopulerkan oleh :

{{ $popular_songs['attributes']['0']['value'] }}

Rilis :

{{ $popular_songs['attributes']['1']['value'] }}

Platform :

{{ $popular_songs['attributes']['2']['value'] }}

Genre :

{{ $popular_songs['attributes']['3']['value'] }}
Beli Lisensi
@endforeach
@elseif($popular_song == 2)
@foreach ($data['landingpage']['popular_songs'] ?? [] as $popular_songs)
{{ $popular_songs['song_title'] }}

{{ $popular_songs['songwriter_name'] }}

@php for ($i = 1; $i <= $popular_songs['total_rating']; $i++) { echo ' '; } @endphp

Dipopulerkan oleh :

{{ $popular_songs['attributes']['0']['value'] }}

Rilis :

{{ $popular_songs['attributes']['1']['value'] }}

Platform :

{{ $popular_songs['attributes']['2']['value'] }}

Genre :

{{ $popular_songs['attributes']['3']['value'] }}
Beli Lisensi
@endforeach
@elseif($popular_song <= 1) @foreach ($data['landingpage']['popular_songs'] ?? [] as $popular_songs)
{{ $popular_songs['song_title'] }}

{{ $popular_songs['songwriter_name'] }}

@php for ($i = 1; $i <= $popular_songs['total_rating']; $i++) { echo ' '; } @endphp

Dipopulerkan oleh :

{{ $popular_songs['attributes']['0']['value'] }}

Rilis :

{{ $popular_songs['attributes']['1']['value'] }}

Platform :

{{ $popular_songs['attributes']['2']['value'] }}

Genre :

{{ $popular_songs['attributes']['3']['value'] }}
Beli Lisensi
@endforeach @endif