@extends('layouts.shared') @php $photos = $property->photos ?? collect(); $videos = $property->videos ?? collect(); $primaryPhoto = $photos->firstWhere('is_primary', true) ?? $photos->first(); $otherPhotos = $photos->filter(fn($p) => $p->id !== ($primaryPhoto->id ?? null)); $allPhotos = $photos->values(); $hasVideos = $videos->isNotEmpty(); $propertyTypeLabel = match($property->property_type) { 'casa' => 'Casa', 'apartamento' => 'Apartamento', 'townhouse' => 'Townhouse', 'local' => 'Local Comercial', 'terreno' => 'Terreno', default => $property->property_type, }; $operationLabel = $property->operation_type === 'venta' ? 'Venta' : 'Alquiler'; $operationBadge = $property->operation_type === 'venta' ? '#007bff' : '#28a745'; $statusLabel = match($property->status) { 'disponible' => 'Disponible', 'reservada' => 'Reservada', 'vendida' => 'Vendida', 'alquilada' => 'Alquilada', 'inactiva' => 'Inactiva', default => $property->status, }; $statusBadge = match($property->status) { 'disponible' => '#28a745', 'reservada' => '#ffc107', 'vendida' => '#dc3545', 'alquilada' => '#fd7e14', 'inactiva' => '#6c757d', default => '#6c757d', }; $shareUrl = url('/compartir/' . $property->shared_token); $shareText = $propertyTypeLabel . ' en ' . $property->city . ' - $' . number_format($property->price, 2); $agency = $property->agency; $agent = $property->agent; $agencySocials = []; if ($agency) { $socialFields = ['facebook', 'instagram', 'linkedin', 'twitter', 'youtube', 'tiktok']; foreach ($socialFields as $s) { if ($agency->$s) { $agencySocials[$s] = $agency->$s; } } } @endphp @section('title', $propertyTypeLabel . ' en ' . $property->city) @push('meta') @if($primaryPhoto) @endif @endpush @section('content')
{{-- MAIN PHOTO --}}
@if($primaryPhoto) {{ $propertyTypeLabel }} @else
Sin imagen disponible
@endif
{{ $operationLabel }} {{ $statusLabel }}
@if($allPhotos->count() > 1)
1 / {{ $allPhotos->count() }}
@endif
{{-- THUMBNAILS + VIDEOS TAB --}} @if($allPhotos->isNotEmpty() || $hasVideos)
@if($hasVideos) @endif
@foreach($allPhotos as $index => $photo)
@endforeach
@if($hasVideos) @endif @endif {{-- PRICE & TITLE --}}

{{ $propertyTypeLabel }} en {{ $property->city }}

${{ number_format($property->price, 2) }}
@if($property->price_negotiable)

💰 Precio negociable

@endif

📍 {{ $property->street_address ?: ($property->urbanization ?: $property->city) }}

{{-- FEATURES --}}

Características

@if($property->rooms_total)
🛏️{{ $property->rooms_total }} Hab.
@endif @if($property->bathrooms_total)
🚿{{ $property->bathrooms_total }} Baños
@endif @if($property->parking_spaces)
🚗{{ $property->parking_spaces }} Estac.
@endif @if($property->land_area)
📐{{ $property->land_area }} m² Terr.
@endif @if($property->construction_area)
🏗️{{ $property->construction_area }} m² Const.
@endif @if($property->antiquity_years)
📅{{ $property->antiquity_years }} Años
@endif
{{-- DESCRIPTION --}} @if($property->observations)

Descripción

{{ $property->observations }}

@endif {{-- LOCATION --}}

Ubicación

@if($property->municipality)@endif @if($property->urbanization)@endif @if($property->street_address)@endif @if($property->building_name)@endif @if($property->floor_number)@endif @if($property->house_apartment_number)@endif @if($property->furnished_status)@endif
Municipio{{ $property->municipality }}
Urbanización{{ $property->urbanization }}
Dirección{{ $property->street_address }}
Edificio{{ $property->building_name }}
Piso{{ $property->floor_number }}
Nro{{ $property->house_apartment_number }}
Amueblado{{ $property->furnished_status }}
{{-- AGENCY --}} @if($agency)

Inmobiliaria

@if($agency->logo_url) @endif @if(!$agency->logo_url)
{{ mb_substr($agency->name, 0, 1) }}
@endif
{{ $agency->name }} @if($agency->legal_name && $agency->legal_name !== $agency->name) @endif @if($agency->nif)

NIF: {{ $agency->nif }}

@endif

Contacto

@if($agency->phone_primary)

Tel.: {{ $agency->phone_primary }}

@endif @if($agency->phone_secondary)

Tel. 2: {{ $agency->phone_secondary }}

@endif @if($agency->email_general)

Email: {{ $agency->email_general }}

@endif @if($agency->email_commercial)

Comercial: {{ $agency->email_commercial }}

@endif @if($agency->website)

Web: {{ $agency->website }}

@endif

Dirección

@php $addrParts = array_filter([$agency->address, $agency->city, $agency->province, $agency->country]); @endphp {{ implode(', ', $addrParts) ?: 'No disponible' }}

@if($agency->years_experience)

Experiencia: {{ $agency->years_experience }} años

@endif
@if($agency->description)

{{ $agency->description }}

@endif @if($agencySocials) @endif @if($agency->representative_name)

Representante Legal

{{ $agency->representative_name }}

@if($agency->representative_position)

{{ $agency->representative_position }}

@endif
@if($agency->representative_phone) 📞 {{ $agency->representative_phone }} @endif @if($agency->representative_email) ✉️ {{ $agency->representative_email }} @endif
@endif
@endif {{-- AGENT --}} @if($agent)

Asesor Inmobiliario

@if($agent->photo_url) {{ $agent->name }} @endif @if(!$agent->photo_url)
{{ mb_substr($agent->name, 0, 1) }}
@endif
{{ $agent->name }} @if($agent->position)

{{ $agent->position }}

@elseif($agent->company_position)

{{ $agent->company_position }}

@endif

Contacto

@if($agent->phone)

Tel.: {{ $agent->phone }}

@endif @if($agent->phone_alternative)

Tel. 2: {{ $agent->phone_alternative }}

@endif @if($agent->email)

Email: {{ $agent->email }}

@endif @if($agent->website)

Web: {{ $agent->website }}

@endif @if($agent->linkedin_profile)

LinkedIn: Ver perfil

@endif

Información

@if($agent->experience_years)

Experiencia: {{ $agent->experience_years }} años

@endif @if($agent->specialization_areas && is_array($agent->specialization_areas) && count($agent->specialization_areas))

Especialización:

    @foreach($agent->specialization_areas as $area)
  • {{ $area }}
  • @endforeach
@endif @if($agent->languages && is_array($agent->languages) && count($agent->languages))

Idiomas:

    @foreach($agent->languages as $lang)
  • {{ $lang }}
  • @endforeach
@endif
@php $waNumber = $agent->whatsapp_number ?: ($agent->whatsapp_same_as_primary ? $agent->phone : null); $waEnabled = $agent->whatsapp_enabled && $waNumber; @endphp @if($waEnabled) Contactar por WhatsApp @endif
@endif {{-- SHARE BUTTONS --}}

Compartir

{{-- LIGHTBOX --}} @endsection