@if (file_exists(public_path('build/manifest.json')) || file_exists(public_path('hot')))
@vite(['resources/css/app.css', 'resources/js/app.js'])
@endif
Back to Dashboard
GET DATA
@if($error)
@endif
API Response
@if($data && !$error)
Success! API call completed successfully.
@endif
@if($data)
API Response Data
@php
// Helper function to flatten nested arrays/objects
function flattenArray($array, $prefix = '', $result = []) {
if (!is_array($array) && !is_object($array)) {
return $result;
}
foreach ((array)$array as $key => $value) {
$newKey = $prefix ? $prefix . '.' . $key : $key;
if (is_array($value) || is_object($value)) {
if (is_array($value) && isset($value[0]) && is_array($value[0])) {
// Handle array of objects - keep as is
$result[$newKey] = $value;
} else {
$result = flattenArray((array)$value, $newKey, $result);
}
} else {
$result[$newKey] = $value;
}
}
return $result;
}
// Helper to format field names
function formatFieldName($key) {
$key = str_replace(['@_', '@', '_'], ['', '', ' '], $key);
return ucwords(strtolower($key));
}
// Extract main sections
$product = $data['PRODUCT'] ?? null;
$status = $product['STATUS'] ?? null;
$echoedFields = $data['ECHOED_FIELDS_ext'] ?? null;
$property = $data['property'] ?? null;
$salesComparables = $data['salesComparables'] ?? $data['salesComparables'] ?? null;
@endphp
@if($status)
Status
| Field |
Value |
@foreach($status as $key => $value)
| {{ formatFieldName($key) }} |
@if(empty($value) && $value !== '0' && $value !== 0)
N/A
@else
{{ $value }}
@endif
|
@endforeach
@endif
@if($echoedFields)
Echoed Fields
| Field |
Value |
@foreach($echoedFields as $key => $value)
| {{ formatFieldName($key) }} |
@if(empty($value) && $value !== '0' && $value !== 0)
Empty
@else
{{ $value }}
@endif
|
@endforeach
@endif
@php
$keyData = $data['KEY'] ?? $data['key'] ?? null;
@endphp
@if($keyData)
KEY
| Name |
Value |
@php
$keyName = $keyData['@_Name'] ?? $keyData['Name'] ?? $keyData['name'] ?? '';
$keyValue = $keyData['@_Value'] ?? $keyData['Value'] ?? $keyData['value'] ?? '';
@endphp
| {{ $keyName ?: 'N/A' }} |
@if(empty($keyValue) && $keyValue !== '0' && $keyValue !== 0)
Empty
@else
{{ $keyValue }}
@endif
|
@endif
@php
// Try different possible response structures
$propertyArray = null;
// Check various possible paths (most specific first)
if (isset($data['RESPONSE_GROUP']['RESPONSE']['RESPONSE_DATA']['PROPERTY_INFORMATION_RESPONSE_ext']['SUBJECT_PROPERTY_ext']['PROPERTY'])) {
$propertyArray = $data['RESPONSE_GROUP']['RESPONSE']['RESPONSE_DATA']['PROPERTY_INFORMATION_RESPONSE_ext']['SUBJECT_PROPERTY_ext']['PROPERTY'];
} elseif (isset($data['property'])) {
$propertyArray = $data['property'];
} elseif (isset($data['PROPERTY'])) {
$propertyArray = $data['PROPERTY'];
} elseif (isset($data['response']['data']['property'])) {
$propertyArray = $data['response']['data']['property'];
} elseif (isset($data['Response']['responseData']['propertyInformationResponseExt']['subjectPropertyExt']['property'])) {
$propertyArray = $data['Response']['responseData']['propertyInformationResponseExt']['subjectPropertyExt']['property'];
} elseif (is_array($data) && isset($data[0]) && is_array($data[0]) && (isset($data[0]['@_StreetAddress']) || isset($data[0]['COMPARABLE_PROPERTY_ext']) || isset($data[0]['PRODUCT_INFO_ext']))) {
// Direct array structure (like the JSON user provided)
$propertyArray = $data;
}
// Normalize to array
$propertyItems = [];
if ($propertyArray) {
if (is_array($propertyArray) && isset($propertyArray[0]) && is_array($propertyArray[0])) {
$propertyItems = $propertyArray;
} elseif (is_array($propertyArray) && !isset($propertyArray[0])) {
$propertyItems = [$propertyArray];
} elseif (is_object($propertyArray)) {
$propertyItems = [(array)$propertyArray];
}
}
// Extract subject property and comparables
$subjectProperty = null;
$comparables = [];
if (!empty($propertyItems)) {
foreach ($propertyItems as $item) {
$item = (array)$item;
// Check if it's subject property (has @_StreetAddress directly or PRODUCT_INFO_ext with SalesCompSubjectProperty)
if (isset($item['@_StreetAddress']) && !isset($item['COMPARABLE_PROPERTY_ext'])) {
// This is subject property
$subjectProperty = $item;
} elseif (isset($item['PRODUCT_INFO_ext']) && is_array($item['PRODUCT_INFO_ext'])) {
$productType = $item['PRODUCT_INFO_ext']['@Product_ext'] ?? '';
if ($productType == 'SalesCompSubjectProperty') {
// Subject property
$subjectProperty = $item;
} elseif ($productType == 'SalesCompProperties' && isset($item['COMPARABLE_PROPERTY_ext'])) {
// Comparable property - extract COMPARABLE_PROPERTY_ext
$compData = is_array($item['COMPARABLE_PROPERTY_ext']) ? $item['COMPARABLE_PROPERTY_ext'] : (array)$item['COMPARABLE_PROPERTY_ext'];
$comparables[] = $compData;
}
} elseif (isset($item['COMPARABLE_PROPERTY_ext'])) {
// Direct comparable property
$compData = is_array($item['COMPARABLE_PROPERTY_ext']) ? $item['COMPARABLE_PROPERTY_ext'] : (array)$item['COMPARABLE_PROPERTY_ext'];
$comparables[] = $compData;
}
}
}
@endphp
@if($data && empty($comparables) && !$subjectProperty)
Debug Info:
Property Items Count: {{ count($propertyItems) }}
Subject Property: {{ $subjectProperty ? 'Found' : 'Not Found' }}
Comparables Count: {{ count($comparables) }}
Data Keys: {{ implode(', ', array_keys($data ?? [])) }}
View Raw JSON
{{ json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) }}
@endif
@if($subjectProperty || !empty($comparables))
Comparables ({{ count($comparables) }} found)
| # |
Dist |
Address |
Subdivision |
Class/Style |
Sqft |
Built |
Lot |
Rms |
Beds |
Bths |
Garage |
Price |
PPSFT |
Sale Date |
Parties |
@if(!$subjectProperty && empty($comparables))
|
No comparables data found. Please check the debug info above.
|
@else
@if($subjectProperty)
@php
$address = ($subjectProperty['@_StreetAddress'] ?? '') . ' ' .
($subjectProperty['@_City'] ?? '') . ' ' .
($subjectProperty['@_State'] ?? '') . ' ' .
($subjectProperty['@_PostalCode'] ?? '');
$subdivision = $subjectProperty['_LEGAL_DESCRIPTION']['@_TextDescription'] ?? '';
$classStyle = $subjectProperty['@StandardUseDescription_ext'] ?? $subjectProperty['@StandardUseCode_ext'] ?? '';
$sqft = $subjectProperty['STRUCTURE']['@GrossLivingAreaSquareFeetCount'] ?? '';
$built = $subjectProperty['STRUCTURE']['STRUCTURE_ANALYSIS']['@PropertyStructureBuiltYear'] ?? '';
$lot = $subjectProperty['SITE']['@LotSquareFeetCount'] ?? '';
$rms = $subjectProperty['STRUCTURE']['@TotalRoomCount'] ?? '';
$beds = $subjectProperty['STRUCTURE']['@TotalBedroomCount'] ?? '';
$baths = $subjectProperty['STRUCTURE']['@TotalBathroomCount'] ?? '';
$garage = $subjectProperty['STRUCTURE']['CAR_STORAGE']['CAR_STORAGE_LOCATION']['@_TypeOtherDescription'] ?? '';
$price = $subjectProperty['SALES_HISTORY']['@PropertySalesAmount'] ?? '';
$ppsqft = $subjectProperty['SALES_HISTORY']['@PricePerSquareFootAmount'] ?? '';
$saleDate = $subjectProperty['SALES_HISTORY']['@PropertySalesDate'] ?? $subjectProperty['SALES_CONTRACT']['@_Date'] ?? '';
$buyer = $subjectProperty['SALES_HISTORY']['@BuyerUnparsedName_ext'] ?? '';
$seller = $subjectProperty['SALES_HISTORY']['@SellerUnparsedName'] ?? '';
// Format sale date
if ($saleDate) {
try {
$date = new DateTime($saleDate);
$saleDate = $date->format('m/d/Y');
} catch (Exception $e) {
// Keep original format
}
}
// Format lot size
if ($lot && is_numeric($lot)) {
$lotAcres = number_format($lot / 43560, 2);
$lot = $lotAcres . ' acr ' . number_format($lot) . ' SF';
}
@endphp
| S |
0.00 |
{{ trim($address) }} |
{{ $subdivision }} |
{{ $classStyle }} |
{{ $sqft ? number_format($sqft) : '' }} |
{{ $built }} |
{{ $lot }} |
{{ $rms }} |
{{ $beds }} |
{{ $baths }} |
{{ $garage }} |
@if($price && is_numeric($price) && $price > 0)
${{ number_format($price, 2) }}
@endif
|
@if($ppsqft && is_numeric($ppsqft) && $ppsqft > 0)
${{ number_format($ppsqft, 2) }}
@endif
|
{{ $saleDate }} |
@if($buyer || $seller)
@if($buyer) B: {{ $buyer }} @endif
@if($buyer && $seller) @endif
@if($seller) S: {{ $seller }} @endif
@endif
|
@endif
@foreach($comparables as $index => $comp)
@php
$address = ($comp['@_StreetAddress'] ?? '') . ' ' .
($comp['@_City'] ?? '') . ' ' .
($comp['@_State'] ?? '') . ' ' .
($comp['@_PostalCode'] ?? '');
$dist = $comp['@DistanceFromSubjectPropertyMilesCount'] ?? '0';
$subdivision = $comp['_LEGAL_DESCRIPTION']['@_TextDescription'] ?? '';
$classStyle = $comp['@StandardUseDescription_ext'] ?? $comp['@StandardUseCode_ext'] ?? '';
$sqft = $comp['STRUCTURE']['@GrossLivingAreaSquareFeetCount'] ?? '';
$built = $comp['STRUCTURE']['STRUCTURE_ANALYSIS']['@PropertyStructureBuiltYear'] ?? '';
$lot = $comp['SITE']['@LotSquareFeetCount'] ?? '';
$rms = $comp['STRUCTURE']['@TotalRoomCount'] ?? '';
$beds = $comp['STRUCTURE']['@TotalBedroomCount'] ?? '';
$baths = $comp['STRUCTURE']['@TotalBathroomCount'] ?? '';
$garage = $comp['STRUCTURE']['CAR_STORAGE']['CAR_STORAGE_LOCATION']['@_TypeOtherDescription'] ?? '';
$price = $comp['SALES_HISTORY']['@PropertySalesAmount'] ?? '';
$ppsqft = $comp['SALES_HISTORY']['@PricePerSquareFootAmount'] ?? '';
$saleDate = $comp['SALES_HISTORY']['@TransferDate_ext'] ?? '';
$buyer = $comp['SALES_HISTORY']['@BuyerUnparsedName_ext'] ?? '';
$seller = $comp['SALES_HISTORY']['@SellerUnparsedName'] ?? '';
// Format sale date
if ($saleDate) {
try {
$date = new DateTime($saleDate);
$saleDate = $date->format('m/d/Y');
} catch (Exception $e) {
// Keep original format
}
}
// Format lot size
if ($lot && is_numeric($lot)) {
$lotAcres = number_format($lot / 43560, 2);
$lot = $lotAcres . ' acr ' . number_format($lot) . ' SF';
}
// Format distance
if ($dist && is_numeric($dist)) {
$dist = number_format($dist, 2);
}
@endphp
| {{ $index + 1 }} |
{{ $dist }} |
{{ trim($address) }} |
{{ $subdivision }} |
{{ $classStyle }} |
{{ $sqft ? number_format($sqft) : '' }} |
{{ $built }} |
{{ $lot }} |
{{ $rms }} |
{{ $beds }} |
{{ $baths }} |
{{ $garage }} |
@if($price && is_numeric($price) && $price > 0)
${{ number_format($price, 2) }}
@endif
|
@if($ppsqft && is_numeric($ppsqft) && $ppsqft > 0)
${{ number_format($ppsqft, 2) }}
@endif
|
{{ $saleDate }} |
@if($buyer || $seller)
@if($buyer) B: {{ $buyer }} @endif
@if($buyer && $seller) @endif
@if($seller) S: {{ $seller }} @endif
@endif
|
@endforeach
@endif
@endif