I have an $lc public array variable in my livewire which contains a boolean. in my view, I have this.
<input @if($lc[$uaf->id]) checked @endif wire:model.prevent.defer="lc.{{ $uaf->id }}" id="lc.{{ $uaf->id }}" type="checkbox" />
the value of $lc[$uaf->id]
is 1 which in boolean represents true. So, it should display a checked box.
but the display is this.
it's not checked.
I have already done this
$lc[$uaf->id] = $uaf->classification->for_locational_clearance;
but it's no luck.
in my livewire
foreach($this->applicant->uafs as $uaf ){
$this->lc[$uaf->id] = $uaf->classification ? $uaf->classification->for_locational_clearance : false;
}
and in my blade file
<input wire:model.prevent.defer="lc.{{ $uaf->id }}" id="lc.{{ $uaf->id }}" type="checkbox" />