@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
{{ $fullAddress }}
Property ID :
Price :
Property Size :
Year Built :
{{ $property->ref_id ?? 'N/A' }}
@if($priceDisplay)€{{ $priceDisplay }}{{ $priceUnit }}@else N/A @endif
{{ number_format($property->area_total, 0, '.', ',') }} Sq Ft
{{ $property->completed_year }}{{ $property->completed_month ? '-' . str_pad($property->completed_month, 2, '0', STR_PAD_LEFT) : '' }}
Bedrooms :
Bathrooms :
Floors :
{{ $property->beds ?? 'N/A' }}
{{ $property->baths ?? 'N/A' }}
{{ $property->floors }}
Property Type :
Property Status :
{{ $propertyTypeName }}
@if($property->is_for_sale == 'Y') For Sale @else For Rent @endif
Built Area :
Terrace Area :
Plot Area :
{{ number_format($property->area_built, 0, '.', ',') }} Sqft
{{ number_format($property->area_terrace, 0, '.', ',') }} Sqft
{{ number_format($property->area_plot, 0, '.', ',') }} Sqft
Smoking Allowed :
Pets Allowed :
{{ $property->smoking_allowed ? 'Yes' : 'No' }}
{{ $property->pets_allowed ? 'Yes' : 'No' }}