@extends('layouts.nova') @section('content') {{-- ── Hero header ── --}} @php $headerBreadcrumbs = collect([ (object) ['name' => 'Creators', 'url' => '/creators/top'], (object) ['name' => 'Top Creators', 'url' => route('creators.top')], ]); @endphp Rising Creators {{-- ── Leaderboard ── --}}
@php $offset = ($authors->currentPage() - 1) * $authors->perPage(); $isFirstPage = $authors->currentPage() === 1; $showcaseTop = $isFirstPage ? $authors->getCollection()->take(3)->values() : collect(); $tableAuthors = $isFirstPage ? $authors->getCollection()->slice(3)->values() : $authors->getCollection(); $rankBase = $isFirstPage ? 3 : 0; @endphp @if ($authors->isNotEmpty()) @if ($showcaseTop->isNotEmpty())
@foreach ($showcaseTop as $i => $author) @php $rank = $i + 1; $profileUrl = ($author->username ?? null) ? '/@' . $author->username : '/profile/' . (int) $author->user_id; $avatarUrl = \App\Support\AvatarUrl::forUser((int) $author->user_id, $author->avatar_hash ?? null, 64); $rankClasses = $rank === 1 ? 'bg-amber-400/15 text-amber-300 ring-amber-400/30' : ($rank === 2 ? 'bg-slate-400/15 text-slate-300 ring-slate-400/30' : 'bg-orange-700/20 text-orange-400 ring-orange-600/30'); @endphp
{{ $rank }} {{ $metric === 'downloads' ? 'Downloads' : 'Views' }}
{{ $author->uname }}
{{ $author->uname ?? 'Unknown' }}
@if (!empty($author->username))
{{ '@' . $author->username }}
@endif
{{ number_format($author->total ?? 0) }}
@endforeach
@endif
{{-- Table header --}}
# Author {{ $metric === 'downloads' ? 'Downloads' : 'Views' }}
{{-- Rows --}}
@foreach ($tableAuthors as $i => $author) @php $rank = $offset + $rankBase + $i + 1; $profileUrl = ($author->username ?? null) ? '/@' . $author->username : '/profile/' . (int) $author->user_id; $avatarUrl = \App\Support\AvatarUrl::forUser((int) $author->user_id, $author->avatar_hash ?? null, 64); @endphp
{{-- Rank badge --}}
@if ($rank === 1) 1 @elseif ($rank === 2) 2 @elseif ($rank === 3) 3 @else {{ $rank }} @endif
{{-- Author info --}} {{ $author->uname }}
{{ $author->uname ?? 'Unknown' }}
@if (!empty($author->username))
{{ '@' . $author->username }}
@endif
{{-- Metric count --}}
{{ number_format($author->total ?? 0) }}
@endforeach
{{ $authors->withQueryString()->links() }}
@else

No authors found.

@endif
@endsection