@extends('layouts.app') @section('content') @php $mainImage = $property->images->where('is_default', 'Y')->first() ?? $property->images->first(); $otherImages = $property->images->where('is_default', '!=', 'Y')->take(4); $allImages = $property->images; // All images for gallery $propertyTypeName = $property->propertyType->texts->first()->name ?? 'N/A'; $description = $property->descriptions->first()->descriptions ?? ''; $addressParts = array_filter([ $property->area->name ?? null, $property->city->name ?? null, $property->state->name ?? null, $property->country->name ?? null ]); $fullAddress = implode(', ', $addressParts); // Helper function to get image URL by size $getImageUrl = function($imagePath, $size = 'large') { if (!$imagePath) return null; $filename = basename($imagePath); return asset( 'files/'. $size . '/' . $filename ); }; // Price formatting $price = $property->price; $salePrice = $price->sale_price ?? 0; $rentLt = $price->rent_lt ?? 0; $rentHs = $price->rent_st_hs ?? 0; $rentSt = $price->rent_st_ls ?? 0; $priceDisplay = ''; $priceUnit = ''; if ($property->is_for_sale == 'Y') { $priceDisplay = number_format($salePrice, 0, '.', ','); $priceUnit = ''; $isForSale = true; } else { if ($rentLt > 0) { $priceDisplay = number_format($rentLt, 0, '.', ','); $priceUnit = '/mo'; } elseif ($rentSt > 0) { $priceDisplay = number_format($rentSt, 0, '.', ','); $priceUnit = '/mo'; } elseif ($rentHs > 0) { $priceDisplay = number_format($rentHs, 0, '.', ','); $priceUnit = '/mo'; } $isForRent = true; } // if ($salePrice > 0) { // $priceDisplay = number_format($salePrice, 0, '.', ','); // $priceUnit = ''; // } elseif ($rentLt > 0) { // $priceDisplay = number_format($rentLt, 0, '.', ','); // $priceUnit = '/mo'; // } elseif ($rentSt > 0) { // $priceDisplay = number_format($rentSt, 0, '.', ','); // $priceUnit = '/mo'; // } // Features grouped $features = $property->features->groupBy(function($feature) { return $feature->pivot->parent_feature_id ?? $feature->parent_id ?? 0; }); @endphp
@foreach($otherImages as $index => $image) @endforeach @if($otherImages->count() < 4) @for($i = $otherImages->count(); $i < 4; $i++)
Placeholder
@endfor @endif
@if($allImages && $allImages->count() > 0) @php $firstImageUrl = $getImageUrl($allImages->first()->image, 'large'); @endphp View Photos {{-- Hidden gallery items for MagnificPopup --}} @foreach($allImages as $galleryImage) @if($galleryImage->id !== $allImages->first()->id) @endif @endforeach @else View Photos @endif
{{--
--}}

{{ $property->ref_id ?? 'Property' }}

{{ $fullAddress }}

@if($priceDisplay)€{{ $priceDisplay }}@else N/A @endif{{ $priceUnit }}

@if($description)

Description

{!! nl2br(e($description)) !!}
@endif

Property Details

  • Property ID :

  • Price :

  • @if($property->area_total)
  • Property Size :

  • @endif @if($property->completed_year)
  • Year Built :

  • @endif
  • {{ $property->ref_id ?? 'N/A' }}

  • @if($priceDisplay)€{{ $priceDisplay }}{{ $priceUnit }}@else N/A @endif

  • @if($property->area_total)
  • {{ number_format($property->area_total, 0, '.', ',') }} Sq Ft

  • @endif @if($property->completed_year)
  • {{ $property->completed_year }}{{ $property->completed_month ? '-' . str_pad($property->completed_month, 2, '0', STR_PAD_LEFT) : '' }}

  • @endif
  • Bedrooms :

  • Bathrooms :

  • @if($property->floors)
  • Floors :

  • @endif
  • {{ $property->beds ?? 'N/A' }}

  • {{ $property->baths ?? 'N/A' }}

  • @if($property->floors)
  • {{ $property->floors }}

  • @endif
  • Property Type :

  • Property Status :

  • {{ $propertyTypeName }}

  • @if($property->is_for_sale == 'Y') For Sale @else For Rent @endif

@if($property->area_built || $property->area_terrace || $property->area_plot)

Additional details

    @if($property->area_built)
  • Built Area :

  • @endif @if($property->area_terrace)
  • Terrace Area :

  • @endif @if($property->area_plot)
  • Plot Area :

  • @endif
    @if($property->area_built)
  • {{ number_format($property->area_built, 0, '.', ',') }} Sqft

  • @endif @if($property->area_terrace)
  • {{ number_format($property->area_terrace, 0, '.', ',') }} Sqft

  • @endif @if($property->area_plot)
  • {{ number_format($property->area_plot, 0, '.', ',') }} Sqft

  • @endif
    @if($property->smoking_allowed !== null)
  • Smoking Allowed :

  • @endif @if($property->pets_allowed !== null)
  • Pets Allowed :

  • @endif
    @if($property->smoking_allowed !== null)
  • {{ $property->smoking_allowed ? 'Yes' : 'No' }}

  • @endif @if($property->pets_allowed !== null)
  • {{ $property->pets_allowed ? 'Yes' : 'No' }}

  • @endif
@endif @if($property->documents->count() > 0)

Property Attachments

@foreach($property->documents as $document) @endforeach
@endif @if($property->features->count() > 0)

Features

@php $featuresPerColumn = ceil($property->features->count() / 3); $featureChunks = $property->features->chunk($featuresPerColumn); @endphp @foreach($featureChunks as $chunk)
    @foreach($chunk as $feature) @php $featureText = $feature->texts->first(); $featureName = $featureText->name ?? 'Feature'; @endphp
  • {{ $featureName }}
  • @endforeach
@endforeach
@endif

Location {{ $fullAddress }}

Logo
@if($similarProperties && $similarProperties->count() > 0) @endif
@push('scripts') @endpush @endsection