Comparables Search
Loading Comparables...
Search Comparables
Show Search Form
Comparables Results
@if($comparablesCount === 0)
No comparable sales
@else
{{ $comparablesCount }} comparable {{ $comparablesCount === 1 ? 'sale' : 'sales' }}
@endif
@if($subjectPropertyRow)
· subject property in table (marked S, not a sale comp)
@endif
Showing {{ $comparablesCount }} nearby sale{{ $comparablesCount === 1 ? '' : 's' }} loaded automatically (all property types). Use filters below to narrow results — some properties limit ATTOM search radius.
@endif
@if(!empty($searchPerformed) && empty($isInitialLoad))
Showing {{ $comparablesCount }} comparables matching your search form (distance, sale date, classification, style, etc.).
Reset to default (all nearby)
@endif
@if(!empty($classificationFilterReduced) && $comparablesCount > 0)
Classification filter applied:
{{ $compsBeforeClassificationFilter ?? 0 }} → {{ $comparablesCount }} comps remain.
@endif
@if(!empty($classificationFilterUnchanged) && $comparablesCount > 0)
Classification filter is working — all {{ $comparablesCount }} nearby sales match your selection
@if(!empty($nearbyClassStyles))
(mostly {{ implode(', ', array_slice($nearbyClassStyles, 0, 2)) }}).
@endif
Use Sales Price, Year Built, or Same Street to narrow further.
@endif
@if(!empty($styleFilterReduced) && $comparablesCount > 0)
Style filter applied:
{{ $compsBeforeStyleFilter ?? 0 }} → {{ $comparablesCount }} comps remain.
@endif
@if(!empty($styleFilterUnchanged) && $comparablesCount > 0 && empty($classificationFilterUnchanged))
Style filter is working — all {{ $comparablesCount }} comps match your style selection.
@endif
@if(!empty($styleFilterMiss))
No comparables matched the Style you selected.
@if(!empty($nearbyStyles))
Nearby sales in this search are mostly:
{{ implode(', ', array_slice($nearbyStyles, 0, 4)) }}.
@endif
@if(!empty($subjectFilterSuggestion['styleLabel']))
For this subject, try {{ $subjectFilterSuggestion['styleLabel'] }}.
@endif
Reset to default
@endif
@if(!empty($classificationFilterMiss))
@php
$typeSummaryParts = [];
if (!empty($nearbyTypeSummary)) {
$typeLabels = [
'condo' => 'condominiums',
'townhouse' => 'townhouses',
'single_family' => 'single-family homes',
'apartment' => 'apartments',
'duplex' => 'duplexes',
'other' => 'other types',
];
foreach ($nearbyTypeSummary as $key => $count) {
$typeSummaryParts[] = $count . ' ' . ($typeLabels[$key] ?? $key);
}
}
@endphp
No comparables matched your selected Classification@if(!empty($searchParams['ddCmaStyle'])) and Style@endif.
@if($typeSummaryParts !== [])
In this search area there are {{ implode(', ', $typeSummaryParts) }} — not townhouses or single-family homes.
@elseif(!empty($nearbyClassStyles))
Nearby sales are mostly:
{{ implode(', ', array_slice($nearbyClassStyles, 0, 4)) }}.
@endif
@if(!empty($subjectFilterSuggestion))
For this subject property, use
{{ $subjectFilterSuggestion['classificationLabel'] }}
@if(!empty($subjectFilterSuggestion['styleLabel']))
+ {{ $subjectFilterSuggestion['styleLabel'] }}
@endif
instead.
@endif
Reset to default
@endif
@if($comparablesCount === 0 && $subjectPropertyRow)
@php
$spAddress = $subjectPropertyRow['address'] ?? 'N/A';
$spClass = $subjectPropertyRow['classStyle'] ?? $subjectPropertyRow['propertyClass'] ?? $subjectPropertyRow['standardUseDescription'] ?? '—';
$spPrice = (float) ($subjectPropertyRow['price'] ?? 0);
$spSqft = (float) ($subjectPropertyRow['sqft'] ?? 0);
@endphp
Subject property (not a comparable sale)
{{ $spAddress }}
{{ $spClass }}
@if($spSqft > 0) · {{ number_format($spSqft, 0) }} sqft @endif
@if($spPrice > 0) · ${{ number_format($spPrice, 0) }} @endif
Map View
Note: Sales highlighted in yellow are Potential Flips; green are Potential Distressed Sales.
| # | Photo | Dist | Address | Subdivision | Class/Style | School District | Sqft | Built | Lot | Rms | Beds | Bths | Garage | Price | PPSFT | Sale Date | Parties |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| No comparable sales matched your search. Adjust classification, distance, or sale date and search again. | |||||||||||||||||
|
@php
$isSubject = $comp['isSubject'] ?? false;
// Count non-subject comparables before this one for numbering
$comparableNumber = 0;
if (!$isSubject) {
// Count how many non-subject comparables are before this one
foreach ($comparablesTableRows as $i => $c) {
if ($i < $index && !($c['isSubject'] ?? false)) {
$comparableNumber++;
}
}
$comparableNumber++; // This is the next comparable number
}
@endphp
@if($isSubject)
S
@else
{{ $comparableNumber }}
@endif
|
@php
// Get location data (needed for both image URL and display)
$county = $comp['county'] ?? $comp['countyName'] ?? $comp['munname'] ?? '';
$state = $comp['state'] ?? $comp['countrySubd'] ?? '';
// Get coordinates
$lat = $comp['latitude'] ?? $comp['lat'] ?? $comp['location']['latitude'] ?? $comp['location']['lat'] ?? null;
$lng = $comp['longitude'] ?? $comp['lng'] ?? $comp['lon'] ?? $comp['location']['longitude'] ?? $comp['location']['lon'] ?? null;
// Build address string for image URL (with comma format)
$addressLine = $comp['address'] ?? $comp['fullAddress'] ?? $comp['line1'] ?? '';
if ($addressLine && isset($comp['locality'])) {
$addressLine .= ', ' . $comp['locality'];
} elseif ($addressLine && isset($comp['city'])) {
$addressLine .= ', ' . $comp['city'];
}
if ($addressLine && $state) {
$addressLine .= ', ' . $state;
}
if ($addressLine && isset($comp['postal1'])) {
$addressLine .= ' ' . $comp['postal1'];
} elseif ($addressLine && isset($comp['zip'])) {
$addressLine .= ' ' . $comp['zip'];
}
$addressEncoded = urlencode($addressLine);
// Build formatted address for display
$displayAddressLine1 = $comp['address'] ?? $comp['fullAddress'] ?? $comp['line1'] ?? 'N/A';
$displayAddressLine2 = '';
if (isset($comp['locality']) || isset($comp['city'])) {
$city = $comp['locality'] ?? $comp['city'] ?? '';
$stateDisplay = $comp['state'] ?? $comp['countrySubd'] ?? '';
$zip = $comp['postal1'] ?? $comp['zip'] ?? '';
$displayAddressLine2 = trim($city . ' ' . $stateDisplay . ' ' . $zip);
}
$displayAddressLine3 = $comp['subdivision'] ?? $comp['subdname'] ?? $comp['area']['subdname'] ?? '';
$apiKey = env('GOOGLE_MAPS_API_KEY', 'AIzaSyCXanBfpLSRebgnMRqISP9SJQ0OBXRMNJQ');
$imageUrl = '';
// Never call ATTOM from the Blade loop — that caused 500× HTTP calls and 60s/180s FatalErrors.
// Prefer street view by coordinates when present, otherwise by address.
if ($lat && $lng) {
$imageUrl = "https://maps.googleapis.com/maps/api/streetview?"
. "size=80x80"
. "&location={$lat},{$lng}"
. "&fov=90"
. "&heading=235"
. "&pitch=10"
. "&source=outdoor"
. "&key={$apiKey}";
} elseif ($addressEncoded !== '') {
$imageUrl = "https://maps.googleapis.com/maps/api/streetview?"
. "size=80x80"
. "&location={$addressEncoded}"
. "&fov=90"
. "&heading=235"
. "&pitch=10"
. "&source=outdoor"
. "&key={$apiKey}";
}
@endphp
@if($imageUrl)
@php
$detailUrl = route('property.show', ['attomId' => $propertyId ?? '']);
@endphp
No Image
@endif
|
{{ $distanceFormatted }} |
@if($propertyId && $propertyId != '')
@php
$detailUrl = route('property.show', ['attomId' => $propertyId]);
@endphp
{{ $displayAddressLine1 }} @if($displayAddressLine2) {{ $displayAddressLine2 }} @endif @if($displayAddressLine3) {{ $displayAddressLine3 }} @endif @elseif($addressLine && $addressLine != 'N/A') @php $fullAddressForSearch = $addressLine; $addressSearchUrl = route('property.by.address') . '?address=' . urlencode($fullAddressForSearch); @endphp {{ $displayAddressLine1 }} @if($displayAddressLine2) {{ $displayAddressLine2 }} @endif @if($displayAddressLine3) {{ $displayAddressLine3 }} @endif @else {{ $displayAddressLine1 }} @if($displayAddressLine2) {{ $displayAddressLine2 }} @endif @if($displayAddressLine3) {{ $displayAddressLine3 }} @endif @endif |
@if(!empty($subdivision)) {{ $subdivision }} @else - @endif | @if(!empty($classStyle)) {{ $classStyle }} @else - @endif | {{ $schoolDistrict ?: '-' }} | {{ $sqft > 0 ? number_format($sqft, 0) : '-' }} | {{ $yearBuilt ?: '-' }} | {{ $lot ?: '-' }} | {{ $rooms ?: '-' }} | {{ $beds ?: '-' }} | {{ $baths ?: '-' }} | {{ $garage ?: '-' }} | {{ $price > 0 ? '$' . number_format($price, 0) : '-' }} | {{ $pricePerSqft > 0 ? '$' . number_format($pricePerSqft, 0) : '-' }} | {{ $saleDate ?: '-' }} | {{ $parties ?: '-' }} |
No Comparables Found
No comparables were found matching your search criteria. Try increasing distance, widening the sale date range, or adjusting classification filters.