@php $items = is_object($artworks) && method_exists($artworks, 'toArray') ? $artworks : collect($artworks ?? []); @endphp
@if (!empty($artworks) && (is_countable($artworks) ? count($artworks) > 0 : true))
@foreach ($artworks as $art)
@php
$card = (object)[
'id' => $art->id ?? null,
'name' => $art->name ?? $art->title ?? 'Artwork',
'thumb' => $art->thumb ?? $art->thumb_url ?? null,
'thumb_srcset' => $art->thumb_srcset ?? null,
'uname' => $art->uname ?? $art->author ?? '',
'category_name' => $art->category_name ?? '',
'slug' => $art->slug ?? \Illuminate\Support\Str::slug($art->name ?? 'artwork'),
];
@endphp
@endforeach
@if (is_object($artworks) && method_exists($artworks, 'links'))
{{ $artworks->withQueryString()->links() }}
@endif
@else
@endif
@endsection