@php $index = $index ?? 0; $branch = $branch ?? []; $cities = $cities ?? collect(); $provinces = $provinces ?? collect(); $selectedCity = old("branches.$index.city_id", $branch['city_id'] ?? ($branch->city_id ?? '')); $matchedCity = collect($cities)->first(fn ($city) => (string) $city->id === (string) $selectedCity); $selectedProvince = old("branches.$index.province_id", $branch['province_id'] ?? ($matchedCity->province_id ?? '')); $latitude = old("branches.$index.latitude", $branch['latitude'] ?? ($branch->latitude ?? '')); $longitude = old("branches.$index.longitude", $branch['longitude'] ?? ($branch->longitude ?? '')); @endphp
Branch
@php $active = old("branches.$index.is_active", $branch['is_active'] ?? ($branch->is_active ?? true)); $primary = (string) old('primary_branch', ''); $isPrimary = $primary !== '' ? $primary === (string) $index : (bool) ($branch['is_primary'] ?? ($branch->is_primary ?? ($index === 0 || $index === '0'))); @endphp
Map Location Optional — search or click the map to set this branch’s pin.
Lat: {{ $latitude !== '' && $latitude !== null ? $latitude : '—' }} Lng: {{ $longitude !== '' && $longitude !== null ? $longitude : '—' }}