Show checkbox with "checked" when editing a record

0

I have a registration form with several checkboxes in the view I have it configured in this way:

{!!Form::checkbox('admin','1',false,['id'=>'admin', 'class'=>'uk-checkbox'])!!}

Administrator

This is saved in the database without problem in the migration of laravel I have it configured in this way:

$table->boolean('admin')->default(0);

The user who generates the record has the option to edit it but when he tries to do the checkboxes do not appear selected, how to do so when checking the record the checkboxes that he selected when registering appear selected when editing it.

    
asked by Darwin Gomez 27.11.2017 в 05:13
source

1 answer

0

The third parameter is what makes the checkbox selected or not. To be selected: TRUE ; so that it is not selected: FALSE or NULL .

In the code that you would put like this:

{!!Form::checkbox('admin','1',true,['id'=>'admin', 'class'=>'uk-checkbox'])!!}
    
answered by 27.11.2017 в 08:57