@extends('layouts.app') @section('title', $property->title) @section('page-title', $property->title) @section('content')
All Properties Edit @if(auth()->user()->isAdmin())
@csrf @method('DELETE')
@endif
{{-- Left column --}}
@php $statusClasses = [ 'published' => 'bg-success text-white', 'under_review' => 'bg-warning text-dark', 'unavailable' => 'bg-secondary text-white', ]; $statusClass = $statusClasses[$property->status] ?? 'bg-secondary text-white'; @endphp
{{ ucwords(str_replace('_', ' ', $property->status)) }} {{ \App\Models\Property::LISTING_PURPOSES[$property->listing_purpose] ?? $property->listing_purpose }}

{{ $property->title }}

{{ $property->city ? $property->city . ' · ' : '' }}{{ $property->location }}

{{ $property->formattedPrice() }}
{{ $property->area }} {{ strtoupper($property->area_unit) }}
Purpose
{{ \App\Models\Property::LISTING_PURPOSES[$property->listing_purpose] ?? '—' }}
Type
{{ (\App\Models\Property::typeLabels())[$property->type] ?? ucwords(str_replace('_', ' ', $property->type)) }}
City
{{ $property->city ?? '—' }}
Area
{{ $property->area }} {{ strtoupper($property->area_unit) }}
Price
{{ $property->formattedPrice() }}
Added
{{ $property->created_at->format('d M Y') }}
@if($property->description)

{!! nl2br(e($property->description)) !!}

@endif @php $visibleTags = $property->tags->where('is_active', true); @endphp @if($visibleTags->isNotEmpty())
@foreach($visibleTags as $tag) {{ $tag->name }} @endforeach
@endif
{{-- Image gallery --}} @include('property.partials._image_gallery', ['property' => $property]) {{-- Document vault --}} @include('property.partials._document_vault', ['property' => $property, 'documentTypes' => $documentTypes]) {{-- Type-specific details --}} @if($property->type_details && $fieldTemplates->isNotEmpty())
{{ ucwords(str_replace('_', ' ', $property->type)) }} Details
@foreach($fieldTemplates as $field) @php $val = $property->type_details[$field->field_key] ?? null; @endphp @if($val !== null && $val !== '')
{{ $field->field_label }}
@if($field->field_type === 'boolean') {!! $val ? 'Yes' : 'No' !!} @else {{ $val }} @endif
@endif @endforeach
@endif {{-- Status history --}} {{-- Price History --}} @if($property->priceHistory->isNotEmpty())
Price History
{{ $property->priceHistory->count() }} {{ Str::plural('change', $property->priceHistory->count()) }}
@foreach($property->priceHistory as $log) @endforeach
Old Price New Price Changed By Date / Time Note
{{ $log->formattedOldPrice() }} {{ $log->formattedNewPrice() }} {{ $log->changedBy->name ?? '—' }} {{ $log->created_at->format('d M Y, H:i') }} {{ $log->note ?? '—' }}
@endif {{-- Status History --}} @if(auth()->user()->isAdmin() && $property->statusLogs->isNotEmpty())
Status History
@foreach($property->statusLogs as $log) @endforeach
From To Changed By Notes When
{{ $log->from_status ? ucwords(str_replace('_', ' ', $log->from_status)) : '—' }} {{ ucwords(str_replace('_', ' ', $log->to_status)) }} {{ $log->changedBy->name ?? '—' }} {{ $log->notes ?? '—' }} {{ $log->created_at->format('d M Y, H:i') }}
@endif {{-- Site Visits --}}
Site Visits {{ $property->siteVisits->count() }}
@if($property->siteVisits->isEmpty())
No site visits recorded for this property.
@else
@foreach($property->siteVisits as $visit) @php $visitLead = $visit->lead; $visitReq = $visitLead ? $visitLead->requirement : null; $visitClient = $visitReq ? $visitReq->client : null; @endphp @endforeach
Client Requirement Stage at Visit Date & Time Staff Notes
@if($visitClient) {{ $visitClient->full_name }} @else @endif @if($visitReq) {{ \App\Models\ClientRequirement::INTEREST_TYPES[$visitReq->interest_type] ?? $visitReq->interest_type }} @if($visitReq->property_type) · {{ \App\Models\ClientRequirement::PROPERTY_TYPES[$visitReq->property_type] ?? $visitReq->property_type }} @endif @else — @endif @if($visit->stageSnapshot) {{ $visit->stageSnapshot->name }} @else @endif {{ $visit->formattedVisitDateTime() }} {{ $visit->accompanying_staff }} {{ $visit->notes ?: '—' }}
@endif
{{-- Right column --}}
{{-- Location Map --}} @php $mapsKey = config('services.google.maps_key'); @endphp @if($property->latitude && $property->longitude)
@if($mapsKey) Property location map @else
@endif
@elseif($mapsKey || true)
No GPS coordinates saved for this property.
@endif
Owner
@if($property->owner)
{{ $property->owner->name }}
{{ $property->owner->mobile }}
@if($property->owner->email)
{{ $property->owner->email }}
@endif @if($property->owner->address)
{{ $property->owner->address }}
@endif @else @endif
@if($property->broker)
Broker
{{ $property->broker->name }}
{{ $property->broker->mobile }}
@endif @if(auth()->user()->isAdmin() && $property->listing_purpose === 'for_rent') @php $managedCardClass = 'card border-0 shadow-sm mb-4' . ($property->is_managed ? ' border-success border-opacity-50' : ''); @endphp
Managed by {{ \App\Models\AppSetting::get('company_name', 'Agrawal Properties') }}
@if($property->is_managed) Rent collection tracking is active. View checklist → @else Enable to track monthly rent collection. @endif
@csrf @method('PATCH')
is_managed ? 'checked' : '' }} style="cursor:pointer;width:2.5em;height:1.4em">
@endif
Metadata
@if($property->sourcingChannel)
Source {{ $property->sourcingChannel->name }}
@endif
Added by {{ $property->createdBy->name ?? '—' }}
@if($property->updatedBy)
Last edited by {{ $property->updatedBy->name }}
@endif
Created {{ $property->created_at->format('d M Y') }}
@endsection