I have an array in PHP like this:
[
'1' => 'City 1',
'3' => 'City 3',
'2' => 'City 2',
]
When I pass this to Livewire and loop through the options like this:
<select wire:model.lazy="city" class="form-row">
@foreach ($cities as $id => $name)
<option value="{{ $id }}" wire:key="{{ $id }}">{{ $name }}</option>
@endforeach
</select>
It always outputs the options ordered alphabetically by key, but I want them like in the array above. What is the issue and how to resolve it?