When using laravel, there is a problem with saving check boxes to the database. This is the demo of html:
https://jsfiddle.net/4j3hoyvn/
Question:
How to save the checkbox in the form in the database? Create a separate table?
The effect to be achieved:
When the "Edit Page" is opened, the check box items selected when creating must be selected. I know how to do radio buttons and other types, but I don't know how to do check boxes.
1. If you are using laravel’s FROMS library, you can judge by blade’s @if and then use it
To generate the selected state of the check box;
2. Of course, you can also use js (such as jq) to change the checked status of the checkbox based on the value
3. You can also use vuejs or Angola’s data binding to change the checked status of the check box
Vuejs case