$this->crud->addField([
'name' => 'status',
'label' => 'Featured item',
'type' => 'checkbox',
]);
The generated code is following:
<div class="form-group col-md-12">
<div class="checkbox">
<label>
<input type="hidden" value="0" name="status">
<input type="checkbox" name="status" value="1"> Featured item
</label>
</div>
</div>
Using the above code for checkbox, Everything works fine, value is saving correctly in database and fetched correctly. But checkbox is not checked.
composer update
fix it for you? I just checked the current checkbox.blade.php file and it seems to have been fixed in the meantime. Cheers! - tabacitucomposer update
again - João Mantovani$fillable
array in my model class wasn't updated after a migration had changed some of my columns. I'd remembered to add new fields to the XyzCrudController but not to the$fillable
array. - Ryan