I see in the docs that we use checkbox like that:
echo Form::checkbox('name', 'value', true);
In my case, value is boolean (0 and 1) and is linked to the next param ( isChecked )
So basically, I should do
<div class="checkbox-switch">
<label>
<?php $old = $tournament->mustPay;
$checked = $old ? 'checked' : '';
?>
{!! Form::label('mustPay', trans('crud.pay4register')) !!} <br/>
{!! Form::checkbox('mustPay', $old, $old , ['class' => 'switch', $checked , 'data-on-text'=>"Si", 'data-off-text'=>"No", "value" => "true"]) !!}
</label>
</div>
It seems very difficult to manage checkbox state without having linking between value and state.
Then I try to avoid to have
I'm spending a lot of time managing it, and get patchwork instead of an elegant solution. Is there an elegant way to do it, because I couldn't find one which fit my needs.... :(
Tx