@extends('layouts.agent') @push('css') @endpush @section('content')
@php $steps = [ 1 => 'Basic Details', 2 => 'Property Details', 3 => 'Location Details', 4 => 'Photos & Videos', ]; $currentStep = request()->route()->getName(); preg_match('/step_(\d+)/', $currentStep, $matches); $activeStep = isset($matches[1]) ? (int) $matches[1] : 1; @endphp
@foreach ($steps as $step => $label)
{{ $step }} {{ $label }} @if ($step < count($steps))
@endif
@endforeach
@if ($errors->any())
    @foreach ($errors->all() as $error)
  • {{ $error }}
  • @endforeach
@endif
@csrf
@error('name')
{{ $message }}
@enderror

@php $bhkOptions = [ '1-RK', '1-BHK', '1.5-BHK', '2-BHK', '2.5-BHK', '3-BHK', '3.5-BHK', '4-BHK', '4.5-BHK', '5-BHK', '6-BHK', '6+ BHK' ]; // For edit mode, get only those BHKs which exist in floorPlans $isEdit = isset($property) && isset($property->id); $selectedBhk = old('bhk_names'); if ($isEdit && empty($selectedBhk)) { $selectedBhk = $property->floorPlans->pluck('name')->toArray(); } // Flats data: only for selected BHKs $flatsData = old('flats'); if ($isEdit && empty($flatsData)) { $flatsData = $property->floorPlans ->keyBy('name') ->map(function ($item) { return $item->toArray(); }) ->toArray(); } @endphp
@foreach ($bhkOptions as $bhk) @php $safeBhk = str_replace(['.', '+', ' '], ['dot', 'plus', '_'], $bhk); $isChecked = in_array($bhk, $selectedBhk ?? []); @endphp
@endforeach
@error('bhk_names')
{{ $message }}
@enderror
@foreach ($bhkOptions as $bhk) @php $safeBhk = str_replace(['.', '+', ' '], ['dot', 'plus', '_'], $bhk); $flat = $flatsData[$bhk] ?? null; $isChecked = in_array($bhk, $selectedBhk ?? []); @endphp
{{ $bhk }}

@foreach ([1, 2, 3, 4, 5] as $option)
@endforeach
@error("flats.$bhk.no_of_bathroom")
{{ $message }}
@enderror
@foreach ([1, 2, 3, 4, 5, 6] as $option)
@endforeach
@error("flats.$bhk.no_of_balcony")
{{ $message }}
@enderror
@foreach ([1, 2, 3, '3+'] as $option)
@endforeach
@error("flats.$bhk.covered_parking")
{{ $message }}
@enderror
@foreach ([1, 2, 3, '3+'] as $option)
@endforeach
@error("flats.$bhk.open_parking")
{{ $message }}
@enderror
@foreach ([ 'fully-furnished' => 'Fully Furnished', 'semi-furnished' => 'Semi Furnished', 'unfurnished' => 'Unfurnished', ] as $value => $label)
@endforeach
@error("flats.$bhk.furnish_type")
{{ $message }}
@enderror
@error("flats.$bhk.built_up_area")
{{ $message }}
@enderror @error("flats.$bhk.area_unit")
{{ $message }}
@enderror
@error("flats.$bhk.carpet_area")
{{ $message }}
@enderror
@php $totalFloors = old("flats.$bhk.total_floors", $flat['total_floors'] ?? ''); $propertyOnFloor = old("flats.$bhk.property_on_floor", $flat['property_on_floor'] ?? ''); @endphp
@error("flats.$bhk.total_floors")
{{ $message }}
@enderror
@error("flats.$bhk.property_on_floor")
{{ $message }}
@enderror
@error("flats.$bhk.price_per_sqft")
{{ $message }}
@enderror
@error("flats.$bhk.expected_price")
{{ $message }}
@enderror
@endforeach
@if ($attributes) @foreach ($attributes as $key => $attribute) @if ($attribute->name === 'Amenities')
Amenities For Residential ( 2 Amenities are mandatory )
@if ($attribute->options) @foreach ($attribute->options as $okey => $option)
id, old('attributes.' . $attribute->name, $data_attributes[$attribute->name] ?? [])) ? 'checked' : '' }}>
@endforeach @endif @error('attributes')
{{ $message }}
@enderror
{{-- JS validation error placeholder --}}
@endif @endforeach @endif
Back
@endsection @section('scripts') @endsection