I have worked with checkboxes for years, and it seems so neat to do an array, but the array becomes a mess to deal with. I like working with individual checkboxes. Just a little more code.
Any example convert to laravel request methods.
In controller:
$adopted = (isset($_POST['adopted']) == '1' ? '1' : '0');
If adopted was not passed
The animal's checkbox wasn't checked thus a
0 is stored
And the animal is still available for adoption.
Otherwise a 1 (one) is stored and the animal has been adopted.
In a view when showing form
<input type="checkbox" name="adopted" id="adopted" value="1"<?php echo ($cat->adopted == 1 ? ' checked' : ''); ?>>
So if a 1 (one) is already stored in the database, the checkbox will be checked. Otherwise the checkbox will not be checked.
If you stay away from that multi check array stuff you won't have these problems.
Just work with individual single checkboxes. So there's 20 of them, so what.