This commit is contained in:
2026-03-20 21:17:26 +01:00
parent 1a62fcb81d
commit 29c3ff8572
229 changed files with 13147 additions and 2577 deletions

View File

@@ -21,6 +21,10 @@ class LatestController extends Controller
$perPage = 21;
$artworks = $this->artworks->browsePublicArtworks($perPage);
$artworks->getCollection()->load([
'user:id,name,username',
'user.profile:user_id,avatar_hash',
]);
$artworks->getCollection()->transform(function (Artwork $artwork) {
$primaryCategory = $artwork->categories->sortBy('sort_order')->first();
@@ -34,10 +38,18 @@ class LatestController extends Controller
'content_type_name' => $primaryCategory?->contentType?->name ?? '',
'content_type_slug' => $primaryCategory?->contentType?->slug ?? '',
'category_name' => $categoryName,
'category_slug' => $primaryCategory?->slug ?? '',
'gid_num' => $gid,
'slug' => $artwork->slug,
'thumb_url' => $present['url'],
'thumb_srcset' => $present['srcset'] ?? $present['url'],
'uname' => $artwork->user->name ?? 'Skinbase',
'username' => $artwork->user->username ?? '',
'user_id' => $artwork->user->id,
'avatar_hash' => $artwork->user->profile->avatar_hash ?? null,
'avatar_url' => \App\Support\AvatarUrl::forUser((int) $artwork->user->id, $artwork->user->profile->avatar_hash ?? null, 64),
'width' => $artwork->width,
'height' => $artwork->height,
'published_at' => $artwork->published_at, // required by CursorPaginator
];
});