@extends('layouts.app') @section('content')

Albums

@foreach ($albums as $index => $album) @php // $coverImages = explode(',', $album->cover_image ?? ''); // $smallCoverFile = $coverImages[2] ?? null; // $filename = $smallCoverFile ? basename($smallCoverFile) : null; // $imageUrl = $filename // ? route('admin.albums.image', ['filename' => $filename]) // : 'https://via.placeholder.com/40'; $coverImages = explode(',', $album->cover_image ?? ''); $imageUrl = $coverImages[2] ?? 'https://via.placeholder.com/40'; @endphp @endforeach
Album Artist Release Date Songs Status Actions
{{ $album->title }}
{{ $album->artist->name ?? '-' }} {{ \Carbon\Carbon::parse($album->release_date)->format('d M Y') }} {{ $album->songs()->count() }} @if ($album->status === 'active') Active @elseif($album->status === 'pending') Pending @else Inactive @endif
@endsection @push('styles') @endpush @section('scripts') @endsection