@extends('front.layouts.marketplace') @section('title', $seoTitle) @section('meta_description', $seoDescription) @section('body_page', 'provider-profile') @section('body_class', 'font-sans text-slate-900 antialiased bg-slate-50') @push('head') @php $schemaImage = $coverImage ? asset('storage/'.$coverImage) : null; if (!$schemaImage && isset($profile) && $profile->shouldShowProfilePhoto() && filled($profile->logoPathForVariant('large'))) { $schemaImage = $profile->logoUrlForVariant('large'); } $profileSchema = [ '@context' => 'https://schema.org', '@type' => 'MusicGroup', 'name' => $profileName, 'url' => $canonicalUrl, 'address' => ['@type' => 'PostalAddress', 'addressLocality' => $cityName, 'addressCountry' => 'CO'], ]; if ($schemaImage) $profileSchema['image'] = $schemaImage; if (!empty($publicSameAs ?? [])) $profileSchema['sameAs'] = $publicSameAs; if ($reviewsTotal > 0) { $profileSchema['aggregateRating'] = [ '@type' => 'AggregateRating', 'ratingValue' => number_format((float) $avgRating, 1), 'reviewCount' => $reviewsTotal, 'bestRating' => '5', 'worstRating' => '1', ]; // Include individual Review items so Google can verify authenticity $schemaReviews = ($publicReviews ?? collect())->take(5)->map(function ($r) { $author = $r->clientUser?->first_name ? trim($r->clientUser->first_name.' '.($r->clientUser->last_name ?? '')) : 'Cliente verificado'; $item = [ '@type' => 'Review', 'reviewRating' => ['@type' => 'Rating', 'ratingValue' => (string) $r->rating, 'bestRating' => '5'], 'author' => ['@type' => 'Person', 'name' => $author], ]; if (filled($r->comment)) $item['reviewBody'] = \Illuminate\Support\Str::limit(strip_tags($r->comment), 500); if ($r->created_at) $item['datePublished'] = $r->created_at->toDateString(); return $item; })->values()->all(); if (!empty($schemaReviews)) { $profileSchema['review'] = $schemaReviews; } } @endphp @endpush @push('styles') @endpush @section('content') @php $avatarImage = $profile->shouldShowProfilePhoto() && filled($profile->logoPathForVariant('large')) ? $profile->logoUrlForVariant('large') : null; $bannerImage = $coverImage ? asset('storage/'.$coverImage) : null; $avatarInitials = $profile->avatarInitials(); $featuredListing = $profile->activeListings->first(); $joinedDate = $profile->user?->created_at; $joinedLabel = $joinedDate ? \Illuminate\Support\Str::ucfirst($joinedDate->translatedFormat('F Y')) : 'Reciente'; $coverageAreas = collect([$cityName]) ->merge($profile->serviceAreas->pluck('city_name')) ->filter() ->unique() ->values(); $socialLinks = collect([ ['label' => 'Sitio web', 'url' => $profile->website], ['label' => 'Instagram', 'url' => $profile->instagram], ['label' => 'Facebook', 'url' => $profile->facebook], ['label' => 'TikTok', 'url' => $profile->tiktok], ['label' => 'YouTube', 'url' => $profile->youtube], ])->filter(fn (array $link): bool => filled($link['url']))->values(); $publicProfileLabel = '@'.$profile->slug; // Auto-generated slugs follow the m-{hash} pattern — not meaningful to clients $isAutoSlug = (bool) preg_match('/^m-[a-z0-9]{6,}$/', $profile->slug ?? ''); $summaryProgress = max(12, min(100, (int) ($profile->profile_completed ? 100 : ($profile->profile_completion ?? 0)))); $verificationUiLabel = $profile->hasActiveVerification() ? 'Perfil verificado' : 'Perfil publicado'; $profileIntro = $profile->short_description ?: null; $activeSection = $activeSection ?? 'perfil'; // WhatsApp & phone CTAs $profileWhatsappRaw = $featuredListing?->getPublicWhatsappForDisplay() ?: ($profile->whatsapp ?: ($profile->user?->phone ?? null)); $profileWhatsappNorm = $profileWhatsappRaw ? \App\Models\MariachiListing::normalizePhoneForUrl($profileWhatsappRaw) : null; $profileWhatsappUrl = $profileWhatsappNorm ? 'https://wa.me/'.$profileWhatsappNorm.'?text='.rawurlencode('Hola '.$profileName.', vi tu perfil en Mariachis.co y me gustaría cotizar.') : null; $profilePhoneRaw = $featuredListing?->getPublicPhoneForDisplay() ?: ($profile->user?->phone ?? null); $profilePhoneNorm = $profilePhoneRaw ? \App\Models\MariachiListing::normalizePhoneForUrl($profilePhoneRaw) : null; $profilePhoneUrl = $profilePhoneNorm ? 'tel:+'.$profilePhoneNorm : null; // Price from featured listing $featuredListingPrice = $featuredListing?->base_price; // Event types from active listings (up to 3) $profileEventTypes = $profile->activeListings ->flatMap(fn ($l) => $l->eventTypes->pluck('name')) ->filter() ->unique() ->take(3) ->values(); // Featured review — uses the controller-loaded collection (no N+1) $featuredReview = ($publicReviews ?? collect())->first(); $profileSectionUrl = route('mariachi.provider.public.show', ['handle' => $profile->slug]); $announcementsSectionUrl = route('mariachi.provider.public.section', ['handle' => $profile->slug, 'section' => 'anuncios']); $coverageSectionUrl = route('mariachi.provider.public.section', ['handle' => $profile->slug, 'section' => 'cobertura']); $socialSectionUrl = route('mariachi.provider.public.section', ['handle' => $profile->slug, 'section' => 'redes']); @endphp @if(! empty($pendingActivation)) @php $isAdminViewing = ! empty($pendingActivationIsAdmin); @endphp
@if($isAdminViewing)

Vista admin — Perfil pendiente de activación

Este perfil no es visible para el público. El mariachi debe completar el pago de activación para que aparezca en el marketplace.

@else

Vista previa de tu perfil público

Esta página estará disponible para los clientes una vez que completes la activación de tu cuenta.

@endif
@if(! $isAdminViewing) Activar cuenta → @endif
@endif
@if($bannerImage) Portada de {{ $profileName }} @endif
{{ $profile->hasActiveVerification() ? 'Perfil verificado en Mariachis.co' : 'Perfil oficial en Mariachis.co' }}
{{-- Avatar solo — espacio libre a la derecha para nombres largos --}}
@if($avatarImage) {{ $profileName }} @else {{ $avatarInitials }} @endif
{{-- Nombre: fila completa debajo del avatar --}}

{{ $profileName }}

@if($profile->hasActiveVerification()) Perfil verificado @endif
@if(! $isAutoSlug) {{ $publicProfileLabel }} @endif
{{ $verificationUiLabel }} {{ $cityName }} @if($reviewsTotal > 0) ★ {{ number_format($avgRating, 1) }} ({{ $reviewsTotal }} {{ $reviewsTotal === 1 ? 'reseña' : 'reseñas' }}) @endif @if($featuredListingPrice) Desde ${{ number_format((float)$featuredListingPrice, 0, ',', '.') }} COP @endif
@if($profileEventTypes->isNotEmpty())
@foreach($profileEventTypes as $et) {{ $et }} @endforeach
@endif
@if($profileWhatsappUrl) Contactar por WhatsApp @endif @if($profilePhoneUrl && !$profileWhatsappUrl) Llamar @endif {{-- Compact trust strip: replaces the 3 bulky metric cards --}}
{{ $cityName }} · Desde {{ $joinedLabel }} @if($profile->active_listings_count > 0) · {{ $profile->active_listings_count }} {{ $profile->active_listings_count === 1 ? 'anuncio' : 'anuncios' }} @endif
@if($featuredListing) Ver anuncio y cotizar @endif
{{-- Mobile sticky CTA -- only when contact info is available --}} @if($profileWhatsappUrl || $profilePhoneUrl)
@if($profileWhatsappUrl) WhatsApp @endif @if($profilePhoneUrl) @endif
@endif @endsection