laravel-bootstrap-4-forms
laravel-bootstrap-4-forms copied to clipboard
pre-select radio not working
Even though the model value is === 0, it is not pre-selecting the radio when:
{!! Form::open()->fill($model !!}
{!! Form::radio('has_tickets', 'No', 0) !!}
<?= $model->has_tickets === 0 ? 'true' : 'false' ?>
Returns 'true';
The issue is caused by type hinting the $value
argument as a string
in the checkbox and radio methods:
https://github.com/netojose/laravel-bootstrap-4-forms/blob/a90c5ada728828793bd81347bdff38e2d2bd6a16/src/FormService.php#L440
Can I ask why? Why not just let the developer pass through their own raw variable. So number can be with or without quotes?