@php $purposeIsRent = $property->listing_purpose === 'for_rent'; $purposeLabel = $purposeIsRent ? 'For Rent' : 'For Sale'; $purposeBadgeClass = $purposeIsRent ? 'badge-rent' : 'badge-sale'; $typeLabel = $propertyTypes[$property->type] ?? ucfirst(str_replace('-', ' ', $property->type)); $detailUrl = $property->public_slug ? route('public.properties.show', ['slug' => $property->public_slug, 'id' => $property->id]) : '#'; // Never `location` (the free-text "Full Address" field) — exact // address must never reach a public page (PUB-12); it's excluded at // the query level too (see PublicPropertySearchService::PUBLIC_COLUMNS). $localityCity = (string) $property->city; $isNew = $property->created_at && $property->created_at->gt(now()->subDays(7)); $bhk = \App\Models\Property::bhkDisplayNumber($property->type_details['bhk'] ?? null); $areaLabel = rtrim(rtrim(number_format((float) $property->area, 2, '.', ''), '0'), '.') . ' ' . $property->area_unit; $specStrip = $bhk ? "{$bhk} BHK · {$areaLabel}" : ($property->type === 'plot' ? "{$areaLabel} plot" : $areaLabel); $chipTags = ($property->tags ?? collect())->take(3); @endphp