@php $relatedPropertyTypes = $propertyTypes ?? \App\Models\Property::typeLabels(); // $property is only ever in scope when included from the detail page // itself (show.blade.php) — unavailable.blade.php's 404 view never // passes it (the property may not even exist), so this must not assume // it's defined. Reflects the ACTUAL detail property's city rather than // a hardcoded "Indore" — this widget is reused for every city this app // ever lists a property in, not just Indore. $relatedCityName = ($property ?? null) ? $property->city : null; @endphp @if (($relatedProperties ?? collect())->isNotEmpty())

Related properties

{{ $relatedCityName ? "similar properties in and around {$relatedCityName}" : 'similar properties you might like' }}
@foreach ($relatedProperties as $related) @include('partials.site._property-card', ['property' => $related, 'propertyTypes' => $relatedPropertyTypes]) @endforeach
@endif