@extends('layouts.modern') @section('title', $listing->property_title . ' - PropertyFinda') @push('styles') @endpush @section('content')
{{ $listing->purpose }} {{ $listing->propertyType->title ?? 'Property' }}

{{ $listing->property_title }}

{{ $listing->address }}
@php $tags = $listing->details->tags ?? $listing->tags ?? []; if(!is_array($tags)) $tags = json_decode($tags, true) ?? []; @endphp @if(count($tags) > 0)
@foreach($tags as $tag) #{{ $tag }} @endforeach
@endif
@if($listing->old_price && $listing->old_price > $listing->price)
£{{ number_format($listing->old_price) }} @php $percentage = round((($listing->old_price - $listing->price) / $listing->old_price) * 100); @endphp -{{ $percentage }}% OFF
@endif £{{ number_format($listing->price) }}
@if(auth()->check()) @else Login for Brochure @endif
@php $gallery = is_array($listing->gallery) ? $listing->gallery : json_decode($listing->gallery, true) ?? []; $floorPlansColumn = is_array($listing->floor_plans) ? $listing->floor_plans : json_decode($listing->floor_plans, true) ?? []; $allMedia = []; // 1. Video if($listing->video) $allMedia[] = ['type' => 'video', 'src' => asset('storage/' . $listing->video), 'label' => 'Video Tour']; // 2. Thumbnail if($listing->thumbnail) $allMedia[] = ['type' => 'image', 'src' => asset('storage/' . $listing->thumbnail), 'label' => 'Main Photo']; // 3. Gallery Column foreach($gallery as $img) $allMedia[] = ['type' => 'image', 'src' => asset('storage/' . $img), 'label' => 'Photo']; // 4. ListingMedia Relation if($listing->media) { foreach($listing->media as $m) { if($m->type === 'photo') { $allMedia[] = ['type' => 'image', 'src' => asset('storage/' . $m->file_path), 'label' => 'Photo']; } elseif($m->type === 'video') { $allMedia[] = ['type' => 'video', 'src' => asset('storage/' . $m->file_path), 'label' => 'Video']; } } } // Collect Documents separately $documents = []; if($listing->epc_upload) $documents[] = ['type' => 'EPC', 'path' => asset('storage/' . $listing->epc_upload), 'name' => 'Energy Performance Certificate']; if($listing->brochure_pdf) $documents[] = ['type' => 'Brochure', 'path' => asset('storage/' . $listing->brochure_pdf), 'name' => 'Property Brochure']; // Add floor plans from column foreach($floorPlansColumn as $fp) { $documents[] = ['type' => 'Floor Plan', 'path' => asset('storage/' . $fp), 'name' => 'Floor Plan']; } // Add documents from Media relation if($listing->media) { foreach($listing->media as $m) { if($m->type === 'floorplan') { $documents[] = ['type' => 'Floor Plan', 'path' => asset('storage/' . $m->file_path), 'name' => 'Floor Plan']; } elseif($m->type === 'epc') { $documents[] = ['type' => 'EPC', 'path' => asset('storage/' . $m->file_path), 'name' => 'EPC Certificate']; } elseif($m->type === 'brochure') { $documents[] = ['type' => 'Brochure', 'path' => asset('storage/' . $m->file_path), 'name' => 'Brochure']; } } } // Remote unique media entries by src to avoid duplicates $allMedia = collect($allMedia)->unique('src')->values()->all(); @endphp

@if(strtolower($listing->bedrooms) === 'studio') Studio @elseif($listing->bedrooms && $listing->bedrooms > 0) {{ $listing->bedrooms }} @else N/A @endif

Beds

{{ $listing->bathrooms && $listing->bathrooms > 0 ? $listing->bathrooms : 'N/A' }}

Baths

{{ $listing->reception_rooms && $listing->reception_rooms > 0 ? $listing->reception_rooms : 'N/A' }}

Recp

{{ $listing->floor_level && $listing->floor_level !== '' ? $listing->floor_level : 'N/A' }}

Floor

{{ $listing->area_size ? (is_numeric($listing->area_size) ? number_format((float)$listing->area_size) : $listing->area_size) : 'N/A' }}

Sqft

About this property

{!! \Illuminate\Support\Str::limit(strip_tags($listing->description), 400) !!}
{!! $listing->description !!}
@if(strlen(strip_tags($listing->description)) > 400) @endif
@php $mi = $listing->materialInfo; // Map legacy or direct listing columns if relation is empty $tenure = $mi->tenure ?? $listing->tenure ?? 'N/A'; $councilTax = $mi->council_tax_band ?? $listing->council_tax_band ?? 'N/A'; $parking = $mi->parking_type ?? $listing->parking_type ?? 'N/A'; $construction = $mi->construction_type ?? $listing->construction_type ?? 'N/A'; $serviceCharge = $mi->service_charge ?? $listing->service_charge ?? null; $groundRent = $mi->ground_rent ?? $listing->ground_rent ?? null; $deposit = $listing->details->deposit ?? $listing->deposit ?? null; @endphp

Financial & Tenure

Tenure Type {{ $tenure }}
@if($mi->unexpired_years ?? $listing->unexpired_years)
Lease Remaining {{ $mi->unexpired_years ?? $listing->unexpired_years }} Years
@endif @if($councilTax && $councilTax !== 'N/A')
Council Tax Band {{ $councilTax }}
@endif @if($deposit)
Deposit @if(is_numeric($deposit))£{{ number_format($deposit, 2) }}@else{{ $deposit }}@endif
@endif @if($serviceCharge)
Service Charge @if(is_numeric($serviceCharge))£{{ number_format($serviceCharge, 2) }}@else{{ $serviceCharge }}@endif
@endif @if($groundRent)
Ground Rent @if(is_numeric($groundRent))£{{ number_format($groundRent, 2) }}@else{{ $groundRent }}@endif
@endif
Parking {{ $parking }}
@if($construction && $construction !== 'N/A')
Construction {{ $construction }}
@endif
@php $scheme = $listing->details->government_scheme ?? $listing->government_scheme; $avail = $listing->availability_date; @endphp @if($avail || $scheme)

Status & Schemes

@if($avail)
Available From {{ \Carbon\Carbon::parse($avail)->format('d M Y') }}
@endif @if($scheme)
Government Scheme {{ $scheme }}
@endif
@endif @php $util = $listing->utilities; // Use values from relation or from listing table direct (for backward compatibility / user's dump) $water = $util->water ?? $listing->utilities_water ?? 'N/A'; $electric = $util->electricity ?? $listing->utilities_electricity ?? 'N/A'; $sewer = $util->sewerage ?? $listing->utilities_sewerage ?? 'N/A'; $heating = $util->heating_type ?? $listing->heating_type ?? 'N/A'; $broadband = $util->broadband ?? $listing->broadband ?? 'N/A'; @endphp

Utilities & Connectivity

Water

{{ $water }}

Electricity

{{ $electric }}

Heating

{{ $heating }}

Broadband

{{ $broadband }}

Mobile

{{ $util->mobile_coverage ?? $listing->mobile_coverage ?? 'Check Area' }}

Sewerage

{{ $sewer }}

@if(count($documents) > 0) @endif

Safety & Risks

Flood Risk {{ $mi->flood_risk ?? $listing->flood_risk ?? 'Very Low' }}
Cladding Risk {{ $mi->cladding_risk ?? $listing->cladding_risk ?? 'None Reported' }}
Coastal Erosion No Risk
Mining History None
@if($listing->rooms->count() > 0)

Room Breakdown

@foreach($listing->rooms as $room)

{{ $room->room_name }}

@if($room->room_description)

{{ $room->room_description }}

@endif
@if($room->room_size)
{{ $room->room_size }}
@endif
@endforeach
@endif
Fetching historical data...
@php $relFeatures = $listing->features->pluck('title')->toArray(); $jsonFeatures = $listing->details->key_features ?? []; if(!is_array($jsonFeatures)) $jsonFeatures = json_decode($jsonFeatures, true) ?? []; $allFeatures = array_unique(array_merge($relFeatures, $jsonFeatures)); @endphp @if(count($allFeatures) > 0)

Key Features

@foreach($allFeatures as $feature)
{{ $feature }}
@endforeach
@endif @if($listing->latitude && $listing->longitude) @endif
@push('modals') @endpush @endsection @push('scripts') @endpush