refactor: unify artwork card rendering
This commit is contained in:
@@ -31,6 +31,8 @@ class LatestController extends Controller
|
||||
return (object) [
|
||||
'id' => $artwork->id,
|
||||
'name' => $artwork->title,
|
||||
'content_type_name' => $primaryCategory?->contentType?->name ?? '',
|
||||
'content_type_slug' => $primaryCategory?->contentType?->slug ?? '',
|
||||
'category_name' => $categoryName,
|
||||
'gid_num' => $gid,
|
||||
'thumb_url' => $present['url'],
|
||||
|
||||
@@ -66,6 +66,8 @@ class FavoriteController extends Controller
|
||||
$a->user?->profile?->avatar_hash ?? null,
|
||||
64
|
||||
),
|
||||
'content_type_name' => $primaryCategory?->contentType?->name ?? '',
|
||||
'content_type_slug' => $primaryCategory?->contentType?->slug ?? '',
|
||||
'category_name' => $primaryCategory->name ?? '',
|
||||
'category_slug' => $primaryCategory->slug ?? '',
|
||||
'width' => $a->width,
|
||||
|
||||
@@ -4,9 +4,11 @@ namespace App\Http\Controllers\User;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Artwork;
|
||||
use App\Support\AvatarUrl;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class TodayInHistoryController extends Controller
|
||||
{
|
||||
@@ -61,21 +63,68 @@ class TodayInHistoryController extends Controller
|
||||
|
||||
// ── Enrich with CDN thumbnails (batch load to avoid N+1) ─────────────────
|
||||
if ($artworks && method_exists($artworks, 'getCollection') && $artworks->count() > 0) {
|
||||
$ids = $artworks->getCollection()->pluck('id')->all();
|
||||
$modelsById = Artwork::whereIn('id', $ids)->get()->keyBy('id');
|
||||
$ids = $artworks->getCollection()->pluck('id')->filter()->map(fn ($id) => (int) $id)->all();
|
||||
$modelsById = Artwork::query()
|
||||
->with([
|
||||
'user:id,name,username',
|
||||
'categories' => function ($query) {
|
||||
$query->select('categories.id', 'categories.name', 'categories.slug', 'categories.sort_order');
|
||||
},
|
||||
])
|
||||
->whereIn('id', $ids)
|
||||
->get()
|
||||
->keyBy('id');
|
||||
|
||||
$artworks->getCollection()->transform(function ($row) use ($modelsById) {
|
||||
/** @var ?Artwork $art */
|
||||
$art = $modelsById->get($row->id);
|
||||
$row->slug = $row->slug ?? Str::slug($row->name ?? '');
|
||||
|
||||
if ($art) {
|
||||
$row->thumb_url = $art->thumbUrl('md') ?? 'https://files.skinbase.org/default/missing_md.webp';
|
||||
$row->art_url = '/art/' . $art->id . '/' . $art->slug;
|
||||
$row->name = $art->title ?: ($row->name ?? 'Untitled');
|
||||
$primaryCategory = $art->categories?->sortBy('sort_order')->first();
|
||||
$author = $art->user;
|
||||
|
||||
try {
|
||||
$present = \App\Services\ThumbnailPresenter::present($art, 'md');
|
||||
$row->thumb_url = $present['url'];
|
||||
$row->thumb_srcset = $present['srcset'] ?? $present['url'];
|
||||
} catch (\Throwable $e) {
|
||||
$row->thumb_url = $art->thumbUrl('md') ?? 'https://files.skinbase.org/default/missing_md.webp';
|
||||
$row->thumb_srcset = $row->thumb_url;
|
||||
}
|
||||
|
||||
$row->url = url('/art/' . $art->id . '/' . ($art->slug ?: Str::slug($art->title ?: ($row->name ?? 'artwork'))));
|
||||
$row->art_url = $row->url;
|
||||
$row->name = $art->title ?: ($row->name ?? 'Untitled');
|
||||
$row->slug = $art->slug ?: $row->slug;
|
||||
$row->width = $art->width;
|
||||
$row->height = $art->height;
|
||||
$row->content_type_name = $primaryCategory?->contentType?->name ?? '';
|
||||
$row->content_type_slug = $primaryCategory?->contentType?->slug ?? '';
|
||||
$row->category_name = $primaryCategory->name ?? '';
|
||||
$row->category_slug = $primaryCategory->slug ?? '';
|
||||
$row->uname = $author->name ?? 'Skinbase';
|
||||
$row->username = $author->username ?? $author->name ?? '';
|
||||
$row->avatar_url = $author
|
||||
? AvatarUrl::forUser((int) $author->getKey(), null, 64)
|
||||
: AvatarUrl::default();
|
||||
} else {
|
||||
$row->thumb_url = 'https://files.skinbase.org/default/missing_md.webp';
|
||||
$row->art_url = '/art/' . $row->id;
|
||||
$row->name = $row->name ?? 'Untitled';
|
||||
$row->thumb_srcset = $row->thumb_url;
|
||||
$row->url = url('/art/' . $row->id . '/' . ($row->slug ?: Str::slug($row->name ?? 'artwork')));
|
||||
$row->art_url = $row->url;
|
||||
$row->name = $row->name ?? 'Untitled';
|
||||
$row->content_type_name = $row->content_type_name ?? '';
|
||||
$row->content_type_slug = $row->content_type_slug ?? '';
|
||||
$row->category_name = $row->category_name ?? '';
|
||||
$row->category_slug = $row->category_slug ?? '';
|
||||
$row->uname = $row->uname ?? 'Skinbase';
|
||||
$row->username = $row->username ?? '';
|
||||
$row->avatar_url = $row->avatar_url ?? AvatarUrl::default();
|
||||
$row->width = $row->width ?? null;
|
||||
$row->height = $row->height ?? null;
|
||||
}
|
||||
|
||||
return $row;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -3,10 +3,11 @@
|
||||
namespace App\Http\Controllers\User;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Artwork;
|
||||
use App\Support\AvatarUrl;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Str;
|
||||
use App\Services\LegacyService;
|
||||
|
||||
class TopFavouritesController extends Controller
|
||||
{
|
||||
@@ -28,14 +29,30 @@ class TopFavouritesController extends Controller
|
||||
}
|
||||
|
||||
if ($paginator && method_exists($paginator, 'getCollection')) {
|
||||
$paginator->getCollection()->transform(function ($row) {
|
||||
$artworkLookup = Artwork::query()
|
||||
->with([
|
||||
'user:id,name,username',
|
||||
'categories' => function ($query) {
|
||||
$query->select('categories.id', 'categories.name', 'categories.slug', 'categories.sort_order');
|
||||
},
|
||||
])
|
||||
->whereIn('id', $paginator->getCollection()->pluck('id')->filter()->map(fn ($id) => (int) $id)->all())
|
||||
->get()
|
||||
->keyBy('id');
|
||||
|
||||
$paginator->getCollection()->transform(function ($row) use ($artworkLookup) {
|
||||
$row->slug = $row->slug ?? Str::slug($row->name ?? '');
|
||||
$ext = pathinfo($row->picture ?? '', PATHINFO_EXTENSION) ?: 'jpg';
|
||||
$encoded = \App\Helpers\Thumb::encodeId((int) $row->id);
|
||||
$row->encoded = $encoded;
|
||||
$row->ext = $ext;
|
||||
|
||||
/** @var \App\Models\Artwork|null $art */
|
||||
$art = $artworkLookup->get((int) $row->id);
|
||||
$primaryCategory = $art?->categories?->sortBy('sort_order')->first();
|
||||
$author = $art?->user;
|
||||
|
||||
try {
|
||||
$art = \App\Models\Artwork::find($row->id);
|
||||
$present = \App\Services\ThumbnailPresenter::present($art ?: (array) $row, 'md');
|
||||
$row->thumb = $row->thumb ?? $present['url'];
|
||||
$row->thumb_srcset = $row->thumb_srcset ?? ($present['srcset'] ?? $present['url']);
|
||||
@@ -44,7 +61,23 @@ class TopFavouritesController extends Controller
|
||||
$row->thumb = $row->thumb ?? $present['url'];
|
||||
$row->thumb_srcset = $row->thumb_srcset ?? ($present['srcset'] ?? $present['url']);
|
||||
}
|
||||
|
||||
$row->thumb_url = $row->thumb ?? null;
|
||||
$row->gid_num = ((int)($row->category ?? 0) % 5) * 5;
|
||||
$row->url = url('/art/' . (int) $row->id . '/' . ($row->slug ?: Str::slug($row->name ?? 'artwork')));
|
||||
$row->width = $art?->width;
|
||||
$row->height = $art?->height;
|
||||
$row->content_type_name = $primaryCategory?->contentType?->name ?? '';
|
||||
$row->content_type_slug = $primaryCategory?->contentType?->slug ?? '';
|
||||
$row->category_name = $primaryCategory->name ?? '';
|
||||
$row->category_slug = $primaryCategory->slug ?? '';
|
||||
$row->uname = $author->name ?? 'Skinbase';
|
||||
$row->username = $author->username ?? $author->name ?? '';
|
||||
$row->avatar_url = $author
|
||||
? AvatarUrl::forUser((int) $author->getKey(), null, 64)
|
||||
: AvatarUrl::default();
|
||||
$row->favourites = (int) ($row->num ?? 0);
|
||||
|
||||
return $row;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ use App\Services\ThumbnailPresenter;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Pagination\AbstractPaginator;
|
||||
use Illuminate\Pagination\AbstractCursorPaginator;
|
||||
|
||||
@@ -180,19 +181,25 @@ class BrowseGalleryController extends \App\Http\Controllers\Controller
|
||||
abort(404);
|
||||
}
|
||||
|
||||
$catSlug = $category->slug;
|
||||
$categorySlugs = $this->categoryFilterSlugs($category);
|
||||
$categoryFilter = collect($categorySlugs)
|
||||
->map(fn (string $slug) => 'category = "' . addslashes($slug) . '"')
|
||||
->implode(' OR ');
|
||||
|
||||
$artworks = Cache::remember(
|
||||
"gallery.cat.{$catSlug}.{$sort}.{$page}",
|
||||
'gallery.cat.' . md5($contentSlug . '|' . implode('|', $categorySlugs)) . ".{$sort}.{$page}",
|
||||
$ttl,
|
||||
fn () => Artwork::search('')->options([
|
||||
'filter' => 'is_public = true AND is_approved = true AND category = "' . $catSlug . '"',
|
||||
'filter' => 'is_public = true AND is_approved = true AND (' . $categoryFilter . ')',
|
||||
'sort' => self::SORT_MAP[$sort] ?? ['created_at:desc'],
|
||||
])->paginate($perPage)
|
||||
);
|
||||
$artworks->getCollection()->transform(fn ($a) => $this->presentArtwork($a));
|
||||
$seo = $this->buildPaginationSeo($request, url('/' . $contentSlug . '/' . strtolower($category->full_slug_path)), $artworks);
|
||||
|
||||
$subcategories = $category->children()->orderBy('sort_order')->orderBy('name')->get();
|
||||
$navigationCategory = $category->parent ?: $category;
|
||||
|
||||
$subcategories = $navigationCategory->children()->orderBy('sort_order')->orderBy('name')->get();
|
||||
if ($subcategories->isEmpty()) {
|
||||
$subcategories = $rootCategories;
|
||||
}
|
||||
@@ -209,6 +216,7 @@ class BrowseGalleryController extends \App\Http\Controllers\Controller
|
||||
'gallery_type' => 'category',
|
||||
'mainCategories' => $mainCategories,
|
||||
'subcategories' => $subcategories,
|
||||
'subcategory_parent' => $navigationCategory,
|
||||
'contentType' => $contentType,
|
||||
'category' => $category,
|
||||
'artworks' => $artworks,
|
||||
@@ -298,6 +306,8 @@ class BrowseGalleryController extends \App\Http\Controllers\Controller
|
||||
return (object) [
|
||||
'id' => $artwork->id,
|
||||
'name' => $artwork->title,
|
||||
'content_type_name' => $primaryCategory?->contentType?->name ?? '',
|
||||
'content_type_slug' => $primaryCategory?->contentType?->slug ?? '',
|
||||
'category_name' => $primaryCategory->name ?? '',
|
||||
'category_slug' => $primaryCategory->slug ?? '',
|
||||
'thumb_url' => $present['url'],
|
||||
@@ -311,6 +321,35 @@ class BrowseGalleryController extends \App\Http\Controllers\Controller
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the category slug filter set for a gallery page.
|
||||
* Includes the current category and all descendant subcategories.
|
||||
*
|
||||
* @return array<int, string>
|
||||
*/
|
||||
private function categoryFilterSlugs(Category $category): array
|
||||
{
|
||||
$category->loadMissing('descendants');
|
||||
|
||||
$slugs = [];
|
||||
$stack = [$category];
|
||||
|
||||
while ($stack !== []) {
|
||||
/** @var Category $current */
|
||||
$current = array_pop($stack);
|
||||
if (! empty($current->slug)) {
|
||||
$slugs[] = Str::lower($current->slug);
|
||||
}
|
||||
|
||||
foreach ($current->children as $child) {
|
||||
$child->loadMissing('descendants');
|
||||
$stack[] = $child;
|
||||
}
|
||||
}
|
||||
|
||||
return array_values(array_unique($slugs));
|
||||
}
|
||||
|
||||
private function resolvePerPage(Request $request): int
|
||||
{
|
||||
$limit = (int) $request->query('limit', 0);
|
||||
|
||||
@@ -429,6 +429,8 @@ final class DiscoverController extends Controller
|
||||
return (object) [
|
||||
'id' => $artwork->id,
|
||||
'name' => $artwork->title,
|
||||
'content_type_name' => $primaryCategory?->contentType?->name ?? '',
|
||||
'content_type_slug' => $primaryCategory?->contentType?->slug ?? '',
|
||||
'category_name' => $primaryCategory->name ?? '',
|
||||
'category_slug' => $primaryCategory->slug ?? '',
|
||||
'gid_num' => $primaryCategory ? ((int) $primaryCategory->id % 5) * 5 : 0,
|
||||
|
||||
@@ -285,6 +285,8 @@ final class ExploreController extends Controller
|
||||
return (object) [
|
||||
'id' => $artwork->id,
|
||||
'name' => $artwork->title,
|
||||
'content_type_name' => $primary?->contentType?->name ?? '',
|
||||
'content_type_slug' => $primary?->contentType?->slug ?? '',
|
||||
'category_name' => $primary->name ?? '',
|
||||
'category_slug' => $primary->slug ?? '',
|
||||
'thumb_url' => $present['url'],
|
||||
|
||||
@@ -6,6 +6,8 @@ use App\Http\Controllers\Controller;
|
||||
use App\Models\Artwork;
|
||||
use App\Services\ArtworkService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class FeaturedArtworksController extends Controller
|
||||
{
|
||||
@@ -24,22 +26,33 @@ class FeaturedArtworksController extends Controller
|
||||
|
||||
$typeFilter = $type === 4 ? null : $type;
|
||||
|
||||
/** @var LengthAwarePaginator $artworks */
|
||||
$artworks = $this->artworks->getFeaturedArtworks($typeFilter, $perPage);
|
||||
|
||||
$artworks->getCollection()->transform(function (Artwork $artwork) {
|
||||
$primaryCategory = $artwork->categories->sortBy('sort_order')->first();
|
||||
$categoryName = $primaryCategory->name ?? '';
|
||||
$categorySlug = $primaryCategory->slug ?? '';
|
||||
$gid = $primaryCategory ? ((int) $primaryCategory->id % 5) * 5 : 0;
|
||||
$present = \App\Services\ThumbnailPresenter::present($artwork, 'md');
|
||||
$username = $artwork->user->username ?? $artwork->user->name ?? 'Skinbase';
|
||||
|
||||
return (object) [
|
||||
'id' => $artwork->id,
|
||||
'name' => $artwork->title,
|
||||
'slug' => $artwork->slug,
|
||||
'url' => url('/art/' . $artwork->id . '/' . Str::slug($artwork->title ?? 'artwork')),
|
||||
'content_type_name' => $primaryCategory?->contentType?->name ?? '',
|
||||
'content_type_slug' => $primaryCategory?->contentType?->slug ?? '',
|
||||
'category_name' => $categoryName,
|
||||
'category_slug' => $categorySlug,
|
||||
'gid_num' => $gid,
|
||||
'thumb_url' => $present['url'],
|
||||
'thumb_srcset' => $present['srcset'] ?? $present['url'],
|
||||
'width' => $artwork->width,
|
||||
'height' => $artwork->height,
|
||||
'uname' => $artwork->user->name ?? 'Skinbase',
|
||||
'username' => $username,
|
||||
];
|
||||
});
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ use App\Models\ContentType;
|
||||
use App\Models\Tag;
|
||||
use App\Services\ArtworkSearchService;
|
||||
use App\Services\EarlyGrowth\GridFiller;
|
||||
use App\Services\Tags\TagDiscoveryService;
|
||||
use App\Services\ThumbnailPresenter;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\View\View;
|
||||
@@ -18,20 +19,27 @@ final class TagController extends Controller
|
||||
public function __construct(
|
||||
private readonly ArtworkSearchService $search,
|
||||
private readonly GridFiller $gridFiller,
|
||||
private readonly TagDiscoveryService $tagDiscovery,
|
||||
) {}
|
||||
|
||||
public function index(Request $request): View
|
||||
{
|
||||
$tags = \App\Models\Tag::withCount('artworks')
|
||||
->orderByDesc('artworks_count')
|
||||
->paginate(80)
|
||||
->withQueryString();
|
||||
$query = trim((string) $request->query('q', ''));
|
||||
$featuredTags = $this->tagDiscovery->featuredTags();
|
||||
$risingTags = $this->tagDiscovery->risingTags($featuredTags);
|
||||
$tags = $this->tagDiscovery->paginatedTags($query);
|
||||
$tagStats = $this->tagDiscovery->stats($tags->total());
|
||||
|
||||
return view('web.tags.index', [
|
||||
'tags' => $tags,
|
||||
'page_title' => 'Browse Tags — Skinbase',
|
||||
'page_canonical' => route('tags.index'),
|
||||
'page_robots' => 'index,follow',
|
||||
'tags' => $tags,
|
||||
'query' => $query,
|
||||
'featuredTags' => $featuredTags,
|
||||
'risingTags' => $risingTags,
|
||||
'tagStats' => $tagStats,
|
||||
'page_title' => 'Browse Tags — Skinbase',
|
||||
'page_meta_description' => 'Explore the most-used artwork tags on Skinbase and jump straight into the styles, themes, and aesthetics you want to browse.',
|
||||
'page_canonical' => route('tags.index'),
|
||||
'page_robots' => 'index,follow',
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -82,6 +90,8 @@ final class TagController extends Controller
|
||||
return (object) [
|
||||
'id' => $a->id,
|
||||
'name' => $a->title ?? ($a->name ?? null),
|
||||
'content_type_name' => $primaryCategory?->contentType?->name ?? '',
|
||||
'content_type_slug' => $primaryCategory?->contentType?->slug ?? '',
|
||||
'category_name' => $primaryCategory->name ?? '',
|
||||
'category_slug' => $primaryCategory->slug ?? '',
|
||||
'thumb_url' => $present['url'] ?? ($a->thumbUrl('md') ?? null),
|
||||
@@ -111,6 +121,15 @@ final class TagController extends Controller
|
||||
];
|
||||
$gallerySort = $sortMapToGallery[$sort] ?? 'trending';
|
||||
|
||||
$sortLabels = [
|
||||
'popular' => 'Most viewed',
|
||||
'likes' => 'Most liked',
|
||||
'latest' => 'Latest uploads',
|
||||
'downloads' => 'Most downloaded',
|
||||
];
|
||||
|
||||
$relatedTags = $this->tagDiscovery->relatedTags($tag);
|
||||
|
||||
// Build simple pagination SEO links
|
||||
$prev = method_exists($artworks, 'previousPageUrl') ? $artworks->previousPageUrl() : null;
|
||||
$next = method_exists($artworks, 'nextPageUrl') ? $artworks->nextPageUrl() : null;
|
||||
@@ -122,6 +141,7 @@ final class TagController extends Controller
|
||||
'contentType' => null,
|
||||
'category' => null,
|
||||
'artworks' => $artworks,
|
||||
'gallery_nav_section' => 'tags',
|
||||
'current_sort' => $gallerySort,
|
||||
'sort_options' => [
|
||||
['value' => 'trending', 'label' => '🔥 Trending'],
|
||||
@@ -129,8 +149,17 @@ final class TagController extends Controller
|
||||
['value' => 'top-rated', 'label' => '⭐ Top Rated'],
|
||||
['value' => 'latest', 'label' => '🕐 Latest'],
|
||||
],
|
||||
'hero_title' => $tag->name,
|
||||
'hero_description' => 'Artworks tagged "' . $tag->name . '"',
|
||||
'hero_title' => '#' . $tag->name,
|
||||
'hero_description' => 'Browse artworks tagged "' . $tag->name . '" and jump between the strongest matching uploads on Skinbase.',
|
||||
'tag_context' => [
|
||||
'name' => $tag->name,
|
||||
'slug' => $tag->slug,
|
||||
'artworks_total' => $artworks->total(),
|
||||
'usage_count' => (int) $tag->usage_count,
|
||||
'current_sort_label' => $sortLabels[$sort] ?? 'Most viewed',
|
||||
'rss_url' => route('rss.tag', ['slug' => $tag->slug]),
|
||||
'related_tags' => $relatedTags,
|
||||
],
|
||||
'breadcrumbs' => collect([
|
||||
(object) ['name' => 'Home', 'url' => '/'],
|
||||
(object) ['name' => 'Tags', 'url' => route('tags.index')],
|
||||
|
||||
@@ -42,9 +42,11 @@ class ArtworkListResource extends JsonResource
|
||||
}
|
||||
|
||||
$contentTypeSlug = null;
|
||||
$contentTypeName = null;
|
||||
$categoryPath = null;
|
||||
if ($primaryCategory) {
|
||||
$contentTypeSlug = optional($primaryCategory->contentType)->slug ?? null;
|
||||
$contentTypeName = optional($primaryCategory->contentType)->name ?? null;
|
||||
$categoryPath = $primaryCategory->full_slug_path ?? null;
|
||||
}
|
||||
$slugVal = $get('slug');
|
||||
@@ -79,6 +81,8 @@ class ArtworkListResource extends JsonResource
|
||||
'slug' => $primaryCategory->slug ?? null,
|
||||
'name' => $decode($primaryCategory->name ?? null),
|
||||
'content_type' => $contentTypeSlug,
|
||||
'content_type_slug' => $contentTypeSlug,
|
||||
'content_type_name' => $decode($contentTypeName),
|
||||
'url' => $webUrl,
|
||||
] : null,
|
||||
'urls' => [
|
||||
|
||||
@@ -589,6 +589,7 @@ final class HomepageService
|
||||
$thumbMd = $artwork->thumbUrl('md');
|
||||
$thumbLg = $artwork->thumbUrl('lg');
|
||||
$thumb = $preferSize === 'lg' ? ($thumbLg ?? $thumbMd) : ($thumbMd ?? $thumbLg);
|
||||
$primaryCategory = $artwork->categories->sortBy('sort_order')->first();
|
||||
|
||||
$authorId = $artwork->user_id;
|
||||
$authorName = $artwork->user?->name ?? 'Artist';
|
||||
@@ -607,6 +608,10 @@ final class HomepageService
|
||||
'thumb' => $thumb,
|
||||
'thumb_md' => $thumbMd,
|
||||
'thumb_lg' => $thumbLg,
|
||||
'category_name' => $primaryCategory->name ?? '',
|
||||
'category_slug' => $primaryCategory->slug ?? '',
|
||||
'content_type_name' => $primaryCategory?->contentType?->name ?? '',
|
||||
'content_type_slug' => $primaryCategory?->contentType?->slug ?? '',
|
||||
'url' => '/art/' . $artwork->id . '/' . ($artwork->slug ?? ''),
|
||||
'width' => $artwork->width,
|
||||
'height' => $artwork->height,
|
||||
|
||||
Reference in New Issue
Block a user