mercredi 3 août 2022

checkbox not displaying checked after putting checked attribute

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." id="lc." 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. 0 it's not checked.

I have already done this

$lc[$uaf->id] = $uaf->classification->for_locational_clearance;

but it's no luck.




Aucun commentaire:

Enregistrer un commentaire