@error('customer_id') {{ $message }} @enderror
@php // Load all properties with their blocks and units $properties = \App\Models\Property::with(['blocks', 'blocks.units']) ->where('CompanyID', auth()->user()->CompanyID) ->get(); // Get all blocks and units for the initial page load $allBlocks = \App\Models\Block::whereIn('PropID', $properties->pluck('PropID'))->get(); $allUnits = \App\Models\ProUnit::whereIn('BlockID', $allBlocks->pluck('BlockID'))->get(); // Get selected values for edit mode $selectedProperty = isset($tenancy) && $tenancy->unit ? $tenancy->unit->PropID : null; $selectedBlock = isset($tenancy) && $tenancy->unit ? $tenancy->unit->BlockID : null; $selectedUnit = isset($tenancy) ? $tenancy->unit_id : null; // Prepare blocks and units data for JavaScript $blocksData = []; foreach ($properties as $property) { $blocksData[$property->PropID] = $property->blocks->map(function($block) { return [ 'id' => $block->BlockID, 'name' => $block->BlockName ]; })->toArray(); } $unitsData = []; foreach ($allBlocks as $block) { $unitsData[$block->BlockID] = $block->units->map(function($unit) { return [ 'id' => $unit->UnitID, 'name' => $unit->UnitIdentity, 'block_id' => $unit->BlockID, 'property_id' => $unit->PropID ]; })->toArray(); } @endphp
@error('unit_id') {{ $message }} @enderror
@push('scripts') @endpush
@error('status_id') {{ $message }} @enderror
@error('start_date') {{ $message }} @enderror
@error('end_date') {{ $message }} @enderror
{{ config('settings.currency_symbol', '$') }}
@error('monthly_rent') {{ $message }} @enderror
{{ config('settings.currency_symbol', '$') }}
@error('security_deposit') {{ $message }} @enderror
@error('move_in_date') {{ $message }} @enderror
@if(isset($tenancy) && $tenancy->status_id == 3) {{-- Assuming 3 is the ID for 'terminated' --}}
@error('move_out_date') {{ $message }} @enderror
@endif
Select additional services for this tenancy @error('services') {{ $message }} @enderror
@if(isset($tenancy) && $tenancy->lease_document_path) @endif @error('lease_document') {{ $message }} @enderror
@error('notes') {{ $message }} @enderror