Populating checkboxes in laravel blade
<p>I'm trying to make a form partial that can be reused for both INSERT and UPDATE. I'm stuck on populating checkboxes. Here what I have:</p>

<pre><code>&lt;input type="checkbox" id="Paid" value="1" name="Paid" 
{{ (old('Paid') ?? $invoice-&gt;Paid ?? false) ? 'checked' : '' }} /&gt;
</code></pre>

<p>It works for when loading the form the first time on both new records and updating. The problem is when a user unchecks the box when editing a record but something else on the form fails validation. When the form loads after failed validation the box that was unchecked is checked again. The database value from $invoice->Paid is loaded because the old() returns false.</p>