How do i tell elequent that a missing check mark is not 0?
- checked is 1
- not checked is 0
If nothing was passed for the checkbox, then 0.
Convert as needed to laravel request, but it looks something like this in php:
$adopted = (isset($_POST['adopted']) == '1' ? '1' : '0');
Where adopted is a checkbox, checked 1 = adopted. not checked 0 = available for adoption.
Do an assessor mutator or whatever you need.
For an edit form:
<input type="checkbox" name="adopted" id="adopted" value="1"<?php echo ($cat->adopted == 1 ? ' checked' : '');
or
<input type="checkbox" name="adopted" id="adopted" value="1" {{ ($cat->adopted == 1 ? ' checked' : '') }}
Don't over think blade, it's just php.