@pushOnce('css') @endPushOnce @forelse ($properties as $key => $data)
Property Image @if ($data->reviews->count() > 0)
@php $review = $data->reviews->sum('rate') / $data->reviews->count(); @endphp @for ($i = 1; $i <= $review; $i++) @endfor @if (is_float($review)) @endif
@endif For Sell @if (!empty($isSponsored)) . Sponsored @endif
@if ($data->user->user_type == 'builder/developer')
@php $bhkTypes = $data->floorplans->pluck('name')->map(function($name) { preg_match('/(\d+)/', $name, $matches); return $matches[1] ?? null; })->filter()->unique()->sort()->values(); $bhkDisplay = $bhkTypes->implode(', '); @endphp {{ $bhkTypes->count() > 1 ? "{$bhkDisplay} BHK Flats in " . ucwords($data->location->name ?? '') : "{$bhkDisplay} BHK Flat in " . ucwords($data->location->name ?? '') }}

{{ ucwords(strtolower($data->locality)) ?? '' }}, {{ ucwords($data->location->name) ?? '' }}

{{ ucwords($data->user->name) ?? '' }}
{{ strtolower($data->user->user_type) == 'builder/developer' ? 'Developer' : ucwords($data->user->user_type) }}
@php // Custom sort logic: $sortedPlans = $data->floorplans->sort(function($a, $b) { // RK check if (stripos($a->name, 'rk') !== false) return -1; if (stripos($b->name, 'rk') !== false) return 1; // Extract BHK numbers preg_match('/\d+/', $a->name, $aMatch); preg_match('/\d+/', $b->name, $bMatch); $aBHK = isset($aMatch[0]) ? (int)$aMatch[0] : 0; $bBHK = isset($bMatch[0]) ? (int)$bMatch[0] : 0; return $aBHK <=> $bBHK; }); @endphp
@foreach ($sortedPlans as $plan)

{{ strtoupper(str_replace('-', ' ', $plan->name)) }} Flat

₹{{ (int) $plan->expected_price }}
@if (!$loop->last)
@endif
@endforeach
@php $price = null; if (!$price) { $prices = $data->floorplans->pluck('price_per_sqft')->filter()->unique()->sort()->values(); $minPrice = $prices->first(); $maxPrice = $prices->last(); } $sizes = $data->floorplans->pluck('built_up_area')->filter()->unique()->sort(); @endphp
Avg. Price: @if ($bhk && isset($price)) ₹{{ (int) $price }}/{{$data->area_unit == 'sqft' ? 'Sq.Ft' : 'Sq.Mtr'}} @elseif (isset($minPrice) && isset($maxPrice)) ₹{{ (int) $minPrice }}{{ $minPrice != $maxPrice ? ' - ₹' . (int) $maxPrice : '' }}/{{$data->area_unit == 'sqft' ? 'Sq.Ft' : 'Sq.Mtr'}} @else Not available @endif
Sizes: {{ $sizes->map(fn($s) => $s . ' ' . ($data->area_unit == 'sqft' ? 'Sq.Ft' : 'Sq.Mtr'))->implode(', ') }}
Status: {{ ucfirst($data->construction_status) }}
Possession: {{ date('d-m-Y', strtotime($data->possession_date)) }}
@else
{{ ucwords($data->name) ?? '' }}

{{ ucwords(strtolower($data->locality)) ?? '' }}, {{ ucwords($data->location->name) ?? '' }}

{{ ucwords($data->user->name) ?? '' }}
{{ strtolower($data->user->user_type) == 'builder/developer' ? 'Developer' : ucwords($data->user->user_type) }}
@if ($data->no_of_bhk)

No. Of BHK

{{ strtoupper(str_replace('-', ' ', $data->no_of_bhk)) }}
@endif @if ($data->construction_status)

Construction Status

{{ ucwords(str_replace('-', ' ', $data->construction_status)) }}
@endif @if ($data->construction_status == 'under-construction' && $data->possession_date)

Possession Date

{{ date('d-m-Y', strtotime($data->possession_date)) }}
@elseif ($data->construction_status == 'ready-to-move' && $data->property_age)

Property Age

{{ $data->property_age }} {{ $data->property_age == 1 ? 'Year' : 'Years' }}
@endif @if ($data->sale_type)

Booking Type

{{ ucfirst(str_replace('-', ' ', $data->sale_type)) }}
@endif @if ($data->carpet_area)

Carpet Area

{{ $data->carpet_area }} {{$data->area_unit == 'sqft' ? 'Sq.Ft' : 'Sq.Mtr'}}
@endif @if ($data->price_per_sqft)

Price Per {{ $data->area_unit == 'sqft' ? 'Sq.Ft' : 'Sq.Mtr' }}

₹{{ $data->price_per_sqft }}
@endif
@endif
@lang('More Info') @if ($data->user) @auth @else @endauth @endif @if ($data->user) @auth
@csrf
@else @endauth @endif
@empty @if (empty($isSponsored))

No properties found.

@endif @endforelse
@if (method_exists($properties, 'hasPages') && $properties->hasPages()) {{ $properties->links() }} @endif
@pushOnce('js') @endPushOnce