Level 10
Fixed
all I had to do was to set value in mount method like this
public function mount(){
$this->currency = 1; // make this dynamic
}
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
hi, devs, Show selected option in livewire not working but if I remove the wire model it works like a charm but then in does not save data
<select wire:model="currency" style="border: none !important;">
@foreach($currencies as $currency)
<option value="{{ $currency->id }}" {{ $selectedCurrency->name == session('currency')['name'] ?
'selected="selected"' : '' }}>{{ $currency->name }}</option>
@endforeach
</select>
Fixed
all I had to do was to set value in mount method like this
public function mount(){
$this->currency = 1; // make this dynamic
}
Please or to participate in this conversation.