@php
$index = 0;
@endphp
@foreach ($songBeforeRelease as $row)
@php
$song = $row->song;
@endphp
@if ($song)
@php
$index++;
$imageUrl = app(\App\Services\SongServices::class)->getCoverImageS3($song, 'sm');
@endphp
@php
$composerName =
$song->songContributors
->where('role', 'Composer')
->pluck('user.name')
->filter()
->implode(', ') ?? '-';
if (empty($composerName)) {
$composerName = ' ';
}
$artistName =
$song->songContributors
->filter(function ($contributor) {
return in_array($contributor->role, ['Artist', 'Cover Creator']);
})
->pluck('user.name')
->filter()
->implode(', ') ?:
' ';
if (empty($artistName)) {
$artistName = 'No Artist';
}
@endphp
@if ($song->created_at >= now()->subDays(7))
NEW
@endif
{{ $song->title }}
{{ $song->created_at->format('D d M Y') }}
Originally by {{ $composerName }}
@endif
@endforeach
@if ($index == 0)
belum terdapat data
@endif
{{-- @php
$newCovers = [
[
'title' => 'Running Up That Hill',
'artist' => 'Meg Myers',
'original' => 'Kate Bush',
'img' => 'https://images.unsplash.com/photo-1470225620780-dba8ba36b745?q=80&w=300',
'id' => 12,
],
[
'title' => 'Feeling Good',
'artist' => 'Muse',
'original' => 'Nina Simone',
'img' => 'https://images.unsplash.com/photo-1493225457124-a3eb161ffa5f?q=80&w=300',
'id' => 13,
],
[
'title' => 'Enjoy the Silence',
'artist' => 'Lacuna Coil',
'original' => 'Depeche Mode',
'img' => 'https://images.unsplash.com/photo-1514525253161-7a46d19cd819?q=80&w=300',
'id' => 14,
],
[
'title' => 'Landslide',
'artist' => 'The Smashing Pumpkins',
'original' => 'Fleetwood Mac',
'img' => 'https://images.unsplash.com/photo-1496293455970-f8581aae0e3b?q=80&w=300',
'id' => 15,
],
[
'title' => 'Jolene',
'artist' => 'The White Stripes',
'original' => 'Dolly Parton',
'img' => 'https://images.unsplash.com/photo-1511671782779-c97d3d27a1d4?q=80&w=300',
'id' => 16,
],
[
'title' => 'Imagine',
'artist' => 'A Perfect Circle',
'original' => 'John Lennon',
'img' => 'https://images.unsplash.com/photo-1501612780327-45045538702b?q=80&w=300',
'id' => 17,
],
[
'title' => 'Bitter Sweet Symphony',
'artist' => 'Taylor Swift',
'original' => 'The Verve',
'img' => 'https://images.unsplash.com/photo-1470225620780-dba8ba36b745?q=80&w=300',
'id' => 18,
],
[
'title' => 'Love Will Tear Us Apart',
'artist' => 'Nouvelle Vague',
'original' => 'Joy Division',
'img' => 'https://images.unsplash.com/photo-1493225457124-a3eb161ffa5f?q=80&w=300',
'id' => 19,
],
[
'title' => 'Careless Whisper',
'artist' => 'Seether',
'original' => 'George Michael',
'img' => 'https://images.unsplash.com/photo-1514525253161-7a46d19cd819?q=80&w=300',
'id' => 20,
],
[
'title' => 'Wonderwall',
'artist' => 'Ryan Adams',
'original' => 'Oasis',
'img' => 'https://images.unsplash.com/photo-1496293455970-f8581aae0e3b?q=80&w=300',
'id' => 21,
],
];
@endphp
@foreach ($newCovers as $cover)
NEW
@endforeach --}}