@extends('layouts.app') @section('title', 'Properties') @section('page-title', 'Properties') @section('content')

{{ $properties->total() }} {{ Str::plural('property', $properties->total()) }} found

Map View Add Property
{{-- Filters --}}
{{-- Row 1: search, type, purpose, status --}}
@if(auth()->user()->isAdmin())
@endif
{{-- Row 2: city, sourcing channel, date range, actions --}}
Clear
{{-- Radius search panel --}}
@if($lat && $lng) @endif
{{-- Radius results map --}} @if($lat && $lng && $radius) @php $mapsKey = config('services.google.maps_key'); @endphp @if($mapsKey)
Results within {{ $radius }} km {{ $properties->total() }}
@push('scripts') @endpush @endif @endif
@include('partials._sort_th', ['column' => 'title', 'label' => 'Title']) @include('partials._sort_th', ['column' => 'city', 'label' => 'City']) @include('partials._sort_th', ['column' => 'price', 'label' => 'Price']) @include('partials._sort_th', ['column' => 'status', 'label' => 'Status']) @include('partials._sort_th', ['column' => 'created_at', 'label' => 'Added']) @forelse($properties as $property) @empty @endforelse
#Purpose TypeOwnerAdded ByActions
{{ $properties->firstItem() + $loop->index }} {{ $property->title }} @php $purposeLabels = \App\Models\Property::LISTING_PURPOSES; @endphp {{ $purposeLabels[$property->listing_purpose] ?? '—' }} {{ (\App\Models\Property::typeLabels())[$property->type] ?? ucwords(str_replace('_', ' ', $property->type)) }} {{ $property->city ?? '—' }} {{ $property->owner->name ?? '—' }} {{ $property->formattedPrice() }} @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'; $availStatus = in_array($property->id, $soldPropertyIds) ? 'sold' : (in_array($property->id, $rentedPropertyIds) ? 'rented' : 'available'); @endphp {{ ucwords(str_replace('_', ' ', $property->status)) }} @if($availStatus === 'sold') Sold @elseif($availStatus === 'rented') Rented @endif @if($property->createdBy) {{ $property->createdBy->name }} @if($property->createdBy->isAdmin()) Admin @else Staff @endif @else — @endif {{ $property->created_at->format('d M Y') }} @if(auth()->user()->isAdmin() || $property->created_by === auth()->id()) @endif @if(auth()->user()->isAdmin()) @endif
No properties found.
@if($properties->hasPages())
{{ $properties->links() }}
@endif
@if(auth()->user()->isAdmin()) @include('partials._admin-password-modal') @endif @endsection @php $mapsKeyIndex = config('services.google.maps_key'); @endphp @if($mapsKeyIndex && !($lat && $lng && $radius)) {{-- Load Maps API for Places Autocomplete on the radius search box (no results map active) --}} @push('scripts') @endpush @elseif($mapsKeyIndex && $lat && $lng && $radius) {{-- When radius map is active, initRadiusMap already loaded the API. Wire up autocomplete inside it. --}} @push('scripts') @endpush @endif