@extends('layouts.nova') @php $uname = $user->username ?? $user->name ?? 'Unknown'; $displayName = $user->name ?? $uname; $avatarUrl = \App\Support\AvatarUrl::forUser((int) $user->id, $user->profile?->avatar_hash, 128); $genderMap = [ 'M' => ['label' => 'Male', 'icon' => 'fa-mars', 'color' => 'text-blue-400'], 'F' => ['label' => 'Female', 'icon' => 'fa-venus', 'color' => 'text-pink-400'], 'X' => ['label' => 'N/A', 'icon' => 'fa-question', 'color' => 'text-gray-400'], ]; $genderCode = strtoupper((string) ($profile?->gender ?? 'X')); $gender = $genderMap[$genderCode] ?? $genderMap['X']; $birthdate = null; if ($profile?->birthdate) { try { $bd = \Carbon\Carbon::parse($profile->birthdate); if ($bd->year > 1900) { $birthdate = $bd->format('F d, Y'); } } catch (\Throwable) {} } $website = $profile?->website ?? null; if ($website && !preg_match('#^https?://#i', $website)) { $website = 'https://' . $website; } $about = $profile?->about ?? null; $lastVisit = null; if ($user->last_visit_at) { try { $lastVisit = \Carbon\Carbon::parse($user->last_visit_at); } catch (\Throwable) {} } $socialIcons = [ 'twitter' => ['icon' => 'fa-brands fa-x-twitter', 'label' => 'X / Twitter'], 'deviantart' => ['icon' => 'fa-brands fa-deviantart', 'label' => 'DeviantArt'], 'instagram' => ['icon' => 'fa-brands fa-instagram', 'label' => 'Instagram'], 'behance' => ['icon' => 'fa-brands fa-behance', 'label' => 'Behance'], 'artstation' => ['icon' => 'fa-solid fa-palette', 'label' => 'ArtStation'], 'youtube' => ['icon' => 'fa-brands fa-youtube', 'label' => 'YouTube'], 'website' => ['icon' => 'fa-solid fa-link', 'label' => 'Website'], ]; $seoPage = max(1, (int) request()->query('page', 1)); $seoBase = url()->current(); $seoQ = request()->query(); unset($seoQ['page']); $seoUrl = fn(int $p) => $seoBase . ($p > 1 ? '?' . http_build_query(array_merge($seoQ, ['page' => $p])) : (count($seoQ) ? '?' . http_build_query($seoQ) : '')); $seoPrev = $seoPage > 1 ? $seoUrl($seoPage - 1) : null; $seoNext = (isset($artworks) && method_exists($artworks, 'nextPageUrl')) ? $artworks->nextPageUrl() : null; @endphp @push('head') @if($seoPrev)@endif @if($seoNext)@endif @endpush @section('content') {{-- ═══════════════════════════════════════════════════════════ PROFILE HERO ═══════════════════════════════════════════════════════════ --}}
{{-- Dark overlay so the content stays readable --}} @if(!empty($heroBgUrl))
@endif
{{-- Avatar --}}
{{ e($uname) }}
{{-- Name + meta --}}

{{ e($uname) }}

@if($displayName && $displayName !== $uname)

{{ e($displayName) }}

@endif @if($countryName)

@if($profile?->country_code) {{ e($countryName) }} @endif {{ e($countryName) }}

@endif @if($lastVisit)

Last seen {{ $lastVisit->diffForHumans() }}

@endif
{{-- Action buttons --}}
@if(!$isOwner) @auth
@else Follow ({{ $followerCount }}) @endauth @else Edit Profile @endif
{{-- ═══════════════════════════════════════════════════════════ STATS STRIP ═══════════════════════════════════════════════════════════ --}}
@foreach([ ['value' => number_format($stats->uploads_count ?? 0), 'label' => 'Uploads', 'icon' => 'fa-cloud-arrow-up'], ['value' => number_format($stats->downloads_received_count ?? 0),'label' => 'Downloads', 'icon' => 'fa-download'], ['value' => number_format($stats->profile_views_count ?? 0), 'label' => 'Profile Views', 'icon' => 'fa-eye'], ['value' => number_format($followerCount), 'label' => 'Followers', 'icon' => 'fa-users'], ['value' => number_format($stats->following_count ?? 0), 'label' => 'Following', 'icon' => 'fa-user-check'], ['value' => number_format($stats->awards_received_count ?? 0), 'label' => 'Awards', 'icon' => 'fa-trophy'], ] as $si)
{{ $si['value'] }}
{{ $si['label'] }}
@endforeach
{{-- ═══════════════════════════════════════════════════════════ MAIN CONTENT ═══════════════════════════════════════════════════════════ --}}
{{-- ─── LEFT COLUMN (artworks) ─── --}}
{{-- Featured Artworks --}} @if(isset($featuredArtworks) && $featuredArtworks->isNotEmpty())
Featured Artworks
@php $feat = $featuredArtworks->first() @endphp {{-- Main featured --}}
{{ e($feat->name) }}

{{ e($feat->name) }}

@if($feat->label)

{{ e($feat->label) }}

@endif @if($feat->featured_at)

Featured {{ \Carbon\Carbon::parse($feat->featured_at)->format('d M, Y') }}

@endif
{{-- Side featured (2nd & 3rd) --}} @if($featuredArtworks->count() > 1)
@foreach($featuredArtworks->slice(1) as $sideArt)
{{ e($sideArt->name) }}

{{ e($sideArt->name) }}

@endforeach
@endif
@endif {{-- Newest Artworks --}}
Newest Artworks View Gallery
@if(isset($artworks) && !$artworks->isEmpty()) @else

No artworks yet.

@endif
{{-- Favourites --}} @if(isset($favourites) && $favourites->isNotEmpty())
Favourites
@foreach($favourites as $fav) @endforeach
@endif
{{-- end left --}} {{-- ─── RIGHT SIDEBAR ─── --}}
{{-- Profile Info --}}
Profile
@if($displayName && $displayName !== $uname) @endif @if($birthdate) @endif @if($countryName) @endif @if($website) @endif @if($lastVisit) @endif
Username {{ e($uname) }}
Real Name{{ e($displayName) }}
Gender {{ $gender['label'] }}
Birthday{{ $birthdate }}
Country @if($profile?->country_code) {{ e($countryName) }} @endif {{ e($countryName) }}
Website {{ e(parse_url($website, PHP_URL_HOST) ?? $website) }}
Last Activity {{ $lastVisit->format('d.M.Y') }} {{ $lastVisit->format('H:i') }}
Member since {{ $user->created_at ? $user->created_at->format('M Y') : 'N/A' }}
{{-- About Me --}} @if($about)
About Me
{!! nl2br(e($about)) !!}
@if(strlen($about) > 300) @endif
@endif {{-- Statistics --}} @if($stats)
Statistics
@foreach([ ['Profile Views', number_format($stats->profile_views_count ?? 0), null], ['Uploads', number_format($stats->uploads_count ?? 0), null], ['Downloads', number_format($stats->downloads_received_count ?? 0), null], ['Page Views', number_format($stats->artwork_views_received_count ?? 0), null], ['Featured Works',number_format($stats->awards_received_count ?? 0), 'fa-star text-yellow-400'], ] as [$label, $value, $iconClass]) @endforeach
{{ $label }} {{ $value }} @if($iconClass)@endif
@endif {{-- Social Links --}} @if(isset($socialLinks) && $socialLinks->isNotEmpty())
Social Links
@foreach($socialLinks as $platform => $link) @php $si = $socialIcons[$platform] ?? ['icon' => 'fa-solid fa-link', 'label' => ucfirst($platform)]; $href = str_starts_with($link->url, 'http') ? $link->url : ('https://' . $link->url); @endphp {{ $si['label'] }} @endforeach
@endif {{-- Recent Followers --}} @if(isset($recentFollowers) && $recentFollowers->isNotEmpty())
Followers {{ number_format($followerCount) }} All
@foreach($recentFollowers as $follower) {{ e($follower->uname) }} @endforeach
@elseif($followerCount > 0)
Followers {{ number_format($followerCount) }}
@endif {{-- Profile Comments --}}
Comments @if(isset($profileComments) && $profileComments->isNotEmpty()) {{ $profileComments->count() }} @endif
@if(!isset($profileComments) || $profileComments->isEmpty())

No comments yet.

@else
@foreach($profileComments as $comment)
{{ e($comment->author_name) }}
{{ e($comment->author_name) }} {{ \Carbon\Carbon::parse($comment->created_at)->diffForHumans() }}

{!! nl2br(e($comment->body)) !!}

@if(!empty($comment->author_signature))

{!! nl2br(e($comment->author_signature)) !!}

@endif
@endforeach
@endif
{{-- Write Comment --}} @auth @if(auth()->id() !== $user->id)
Write a Comment
@if(session('status') === 'Comment posted!')
Comment posted!
@endif
@csrf @error('body')

{{ $message }}

@enderror
@endif @else

Log in to leave a comment.

@endauth
{{-- end right sidebar --}}
{{-- end flex --}}
{{-- end container --}} @endsection @push('scripts') @endpush