In the edit page, I wanted to have checked if the checkbox is true.

```
@foreach($benefits as $benefit)
                        <div class="form-check">
                          <label class="form-check-label" for="benefit[]">
                        @if ($edit)
                            <input class="form-check-input" @if($benefit->id == $user->benefit()->id) 'checked' @endif type="checkbox" value"{{$benefit->id}}" id="benefit_id" name="benefit_id[]">
                        @else
                          <input class="form-check-input" type="checkbox" value="{{$benefit->id}}" id="benefit_id" name="benefit_id[]">
                            {{$benefit->name}}
                          </label>
                        @endif
                        </div>
                    @endforeach

```

Just like in the screenshot i attach. The "Eyewear","Dental", and "AVEGA" should be checked because theyre true in the database. Pls see pic for reference. 
[![enter image description here](https://i.stack.imgur.com/DApp1.png)](https://i.stack.imgur.com/DApp1.png)
Thanks experts